Article 5QF6C Difference between --restart=always Vs having .service file restart container with Podman?

Difference between --restart=always Vs having .service file restart container with Podman?

by
JockVSJock
from LinuxQuestions.org on (#5QF6C)
Just wondering if anyone has any insight having the --restart-always command when launching a container from an image Vs creating a .service file to restart a container, say if server is rebooted?

Are there any pros or cons with either or?

Here is an example of the --restart=always command
Code:[matt@localhost ~]$ podman run -d --name registry -p 5000:5000 -v "$(pwd)"/certs:/certs --restart=always -e REGISTRY_HTTP_ADDR=0.0.0.0:5000 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key --privileged registry:2Reference from this blog:

https://snyk.io/blog/privileged-docker-containers/

Vs.

Using .service file to restart a container:

https://www.tutorialworks.com/podman-systemd/latest?d=yIl2AUoC8zA latest?i=PdVKEcPC2yc:nyhmhthQW8w:F7zBnMy latest?i=PdVKEcPC2yc:nyhmhthQW8w:V_sGLiP latest?d=qj6IDK7rITs latest?i=PdVKEcPC2yc:nyhmhthQW8w:gIN9vFwPdVKEcPC2yc
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments