Set AutoRemove false for running container

Viewed 1821

I wanted to add a restart policy to a running container without restarting it via docker update --restart=always <container-id> but since I originally started the container with the --rm flag (which sets AutoRemove = true) the update fails as you can either set a RestStartPolicy or AutoRemove.

Is there any way to get rid of AutoRemove without stopping and starting the container?

1 Answers

No, you cannot get rid of the AutoRemove flag, docker does not support changing that, because the docker daemon starts monitoring a container with --rm the moment it's started (to perform the removal). According to this Github issue, that would be difficult to implement.

Related