Creating container using a local folder/volume to hold the contyainer created data

Hi All,

I’m new to docker and have been tinkering around with using some of the gitlab images. I can pull down the gitlab/gitlab-ce image and create a new container and connect to it successfully - all fine there.

As part of this image a few volumes are configured

  • /etc/gitlab
  • /var/log/gitlab
  • /var/opt/gitlab

When the container is created they have a host volume created. This host volume is within /var/lib/docker… and I wish to expose those folder to a local mount point - e.g. /dockermounts/gitlab/etc , etc,…

This will enable me to investigate the logs and config locally on the host I am using. I am using this scenario as a test case as I wish to expose more folder for future containers.

But, when I start the container with -v /dockermnount/gitlab/etc:/etc/gitlab the folders are empty - and the container then fails to start.

I hope ive explained it sufficiently and someone can help.

Many thansk