Docker Community Forums

Share and learn in the Docker community.

Docker commit should retain container data in volumes too

(Devopsnetapponaws) #1

Currently docker commit will have the docker container created as a docker image.
But it will be very useful if all the data at that point on mounted volumes can be pushed along with it too.

(Think) #2

is it an option for you to hack this by copying your interesting files from the mount into the container before commiting.

(Prabhushan) #3


Any update on this?

(Sam) #4

i don’t understand this topic

docker commit takes a running container and saves it, at the current state, to a new IMAGE
data external to the container (on volumes) is NOT saved, (well, because its EXTERNAL).

the new IMAGE, like all images, can be used to start a new container.


the purpose of this topic i guess
if for example i have docker image with Volumes and made custom conf files located on this volumes
and what i need i need to commit this image to dockerhub and then pull it elsewhere with my custom settings

But in current situation all edits of files located on volumes are not committed

(Sam) #6

Right… thats part of the fundamental design of volumes… the data is EXTERNAL to the image and container… Docker commit doesn’t know about it.