May 18, 2022·Docker

How do you disable auto-restart on a container?

Hey, quick tip.

If you want to avoid your container start again automatically when your OS restart, just do this two things: First you’ll need to get the IDs of your containers, for this we are going to use docker ps but if you want to get all containers (including those stopped) we can also use this other command:

docker ps --filter "status=exited"

And this other command will do the trick

docker update --restart=no my-container-id

Goodbye!