In Docker for Windows: How do I stop containers from automatically starting on the daemon start?

0 votes
Every time my Docker for Windows daemon boots up, it will start a few containers. Even after I kill a container and then reboot the docker daemon, it still appears.

Can someone help me with this?
Sep 3, 2018 in Docker by Sophie may
• 9,850 points
106 views

2 answers to this question.

0 votes

I’m not quite sure as to why this happens but maybe those containers have a restart policy which will make Docker to run them everytime they’re not there?

Anyhow, try this:

If youre containers are running, before killing them, try this:

docker update --restart=no container1 container2 ....

Then reboot and see if those containers are still running.

answered Sep 3, 2018 by Sophie may
• 9,850 points
0 votes

Docker will autostart any container with a RestartPolicy of 'always' when the docker service initially starts. You'll have to dig into the container configuration to find it.

docker inspect my-container (Look for RestartPolicy in the output)

I've mostly had this situation occur when a container was created with --restart always, and the situation later changed such that I no longer wanted this to happen.

After docker 1.11, this is easy to fix

docker update --restart=no my-container
answered Aug 14 by Sirajul
• 36,620 points

Related Questions In Docker

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to change hosts in Docker for Windows in daemon.json?

you cannot specify options both as a ...READ MORE

answered Oct 16, 2018 in Docker by Tyrion anex
• 8,270 points
843 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,900 points
217 views
0 votes
2 answers

How do I fix the “no space left on device” error in docker?

Try cleaning up: $ docker volume rm $(docker ...READ MORE

answered Aug 14 in Docker by Sirajul
• 36,620 points
2,038 views