Docker Community Forums

Share and learn in the Docker community.

Auto starting a container on system reboot

docker

(Larrymartell59) #21

OK, I will see what they want to do. Thanks again for all your help.


(Larrymartell59) #22

One more question - if I do a --restart=always how can I later disable the restart? And is there a way to query the restart policy currently in effect for a container? (I guess that’s 2 questions :wink:


(Jeff Anderson) #23

Use docker inspect to see everything about a container, including restart policies.

Docker 1.10 added the docker update command that can tune some parts of a container. Docker added the ability to use the docker update command to change the restart policy. See docker update --help on a 1.11 docker.


(Larrymartell59) #24

In 1.7.1 how can I update the restart policy?


(Jeff Anderson) #25

That feature was not added until 1.11, so you’ll have to recreate the container. It is definitely not a good idea to be on 1.7.1. It hasn’t had any security fixes backported to it. I’d recommend getting on latest.


(Larrymartell59) #26

I agree, but in many small companies, upgrading is often a hard sell. Often they don’t want to commit their scarce resources to it, preferring to spend them on bug fixes and new app features. And/or they have the ‘if it ain’t broke don’t fix it’ mentality. I have clients on old versions of django, python, jQuery, and more, and I cannot get them to upgrade.


(Meruvb) #27

When I apply this command “–restart=unless-stopped” the container IP getting packet drop.
And the container status is restarting less than a second .


(Meruvb) #28

I configured static IP for the container.


#29

if anyone else comes across this
docker update CONTAINER --restart always