Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I started a docker container with --rm Is there an easy way to keep it, without redoing everything?

Tags:

docker

Is there a quick way to save the state of a docker container started with the --rm flag, as if you didn't specify it?

like image 890
dagelf Avatar asked Jan 26 '16 08:01

dagelf


1 Answers

Only the upcoming 1.10 docker update command would be able to (eventually) do that (cancel a --rm option)

But the 1.10 version of that command only supports resource configs.
It will be extended though in the future.

So for now, this does not seem possible.
You would have to stop it and relaunch it with the right set of options.

Note: if the issue is that a volume referenced by that container would be lost if you stopped (and automatically remove) said container, know that you can re-attach that volume to a new container.

The docker export mentioned by Joachim Isaksson in the comments is one workaround, but it has limitation (ie it won't export volume)

like image 122
VonC Avatar answered Oct 26 '22 18:10

VonC