I am using genezys/gitlab image to build a gitlab server:
docker run --name gitlab_data genezys/gitlab:7.5.2 /bin/true
docker run --detach --name gitlab --publish 8080:80 --publish 2222:22 --volumes-from gitlab_data genezys/gitlab:7.5.2
Now, I want to backup the gitlab_data container, so the code repository can be stored.
I use docker commit command to generate a new image. Then when creating the container from the new image, I find all the code repository is lost, and it seems a new empty image. I also post this issue on SO, but can’t find the root cause.
Could anyone give some clues? Thanks very much in advance!
Data stored on “volumes” is not actually in the container: it is in a non-obvious directory on the host. Using a data container to share volumes is just a convenient, host-independent-ish way of mapping host volumes into containers. Committing a data container does not save the data, but it doesn’t lose it either – it should still be on the host and should be accessible via the original container.