Is there a way to clone a container and its data into a new one with different starting parameters?
At the moment I'm only able to start a new cloned container (from custom image) WITHOUT the data.
I tell you what I have to do: I started a "docker-jenkins" container with some starting parameters and then configured it, but now I noticed that I forgot some important starting parameters so I wanna restart the same container adding more starting parameters...
The problem is (if I understand well) that I cannot modify the starting parameters of existing running container, so my idea is to start a cloned one (data INCLUDED) with different parameters but I don't understand how to do it...
Can someone help me?
1. Using volumes
If your sole point is to persist your data you need to use Volumes.
Source:
Essentially you map a folder from your machine to one into your container. When you kill the container and spawn a new instance (with modified parameters) your volume (with the existing data) is re-mapped.
Example:
Source:
2. Using commit to create snapshots
A different route is to make use of the docker commit command.
It is also possible to commit with altered configuration: