Disable docker container autostart


How to prevent docker from starting a container automatically on system startup?

Docker will autostart any container with a RestartPolicy of ‘always’ when the docker service initially starts. You won’t find any evidence of this within cron or any other normal system startup scripts; 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.

docker update --restart=no my-container

Similar Posts:


How useful was this post?

Click on a star to rate it!

Average rating 4.9 / 5. Vote count: 25

No votes so far! Be the first to rate this post.

Scroll to Top