I have started a container with the option --rm
, for example:
docker run --rm -it --name test bash
But now I want to keep the container on exit. Is there a way to cancel the --rm
option on an already running container?
I have started a container with the option --rm
, for example:
docker run --rm -it --name test bash
But now I want to keep the container on exit. Is there a way to cancel the --rm
option on an already running container?
This is not possible.
An alternative that might suit you would be to commit your container as a new image and run that image in a new container.
Probably detach and commit the running container is a good choice.
Ctrl+P
, Ctrl+Q
(for Ubuntu).