Can I change a docker container from a self-delete policy to auto-restart?
-
I've got a container started (not my code, not my container, but I often manage the server and deal with the aftermath of it being patched) and I need to make a hot-fix to the deployment strategy, I had gone through the steps to change it to auto-restart, but a coworker noticed that the container was started with
--rm
. My guess is that this is circumventing any attempt to start it up after reboots (because the container just isn't there any more)So is there a way to remove the
--rm
policy from a running container?
-
You can use a docker update. ( https://docs.docker.com/engine/reference/commandline/update/ ).
docker update --restart always /
.Not sure about removing the --rm flag, though