I want to transfer data in a shared container volume to an image. I can't seem to do this? It seems to me that this is possible in Docker, but it seems to be completely contrary to the whole philosophy of not leaving data on the host, so part of me thinks that there should be a way to do this.
1. Terminal 1
Run the container in terminal 1 with the volume.
$ docker run -it -v /data ubuntu:14.10 /bin/bash root@19fead4f6a68 :/
2. Terminal 2
Run the second container in Terminal 2, the file from container 1 is there, so that all dockers work.
$ docker run -it --volumes-from 19fead4f6a68 ubuntu:14.10 /bin/bash root@5c7cdbfc67d8 :/
3. Terminal 3
My understanding is that I can only capture the differences with the images, so I check what differences are on both containers. For some bizarre reason, my changes don't appear! ??
$ docker diff 19fead4f6a68 A /data $ docker diff 5c7cdbfc67d8 A /data
4. Back in terminal 1
I create a file outside the volume folder
root@19fead4f6a68 :/
5. Back to terminal 3
Now we have some changes that we can make, although Iām rather upset, because this is not data from the volume that I need to share with another container.
$ docker diff 19fead4f6a68 A /data C /var A /var/beast.txt
Clearly, this is by design. Does anyone have any ideas as to why docker doesn't allow me to save volume data into a commit? Is there any general exchange of files between containers, and then saving them to an image? I feel like something is missing me? Especially to the ends of the data exchange, avoiding connections between hosts.
docker
rickard
source share