Auto starting a container on system reboot

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

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:

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.

In 1.7.1 how can I update the restart policy?

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.

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.

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

I configured static IP for the container.

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