Gitlab CI + gitlabrunner + docker + volumes

Hi,
I am trying to run a deploy job with Gitlab CI using docker. I need to have several of the host directories available inside the docker container, and am using the volumes configuration setting in the [runners.docker] block.

I need to have access to these directories to be able to access a configuration file and a proxy-file that are needed in order to submit tests to the application I am deploying.

I have the configuration file of my application in the hosts /etc/ folder, and the proxy file lives in the /tmp folder.

What am I doing wrong as I seem to not be able to access the files? See the gitlab-runner configuration file below.

And another question: In my .gitlab-ci.yml file, if I have mounted lets say the hosts /etc folder on /arc/etc - how to ls the files under the volume? Would I do ls /etc or ls /arc/etc ? The latter gives “no such file or directory”. Do I need to create the /arc folder first in my .gitlab-ci.yml file, or should the gitlab-runner configuration file take care of creating this folder?

This is my gitlab-runner configuration file:

 [[runners]]
    name = "centos6-arc-deploy"
    url = "https://source.coderefinery.org/"
    token = "xxxxx"
    executor = "docker"
    [runners.docker]
        tls_verify = false
        image = "maikenp/arc-deploy-centos6"
        privileged = false
        disable_cache = false
        volumes = ["/arc", 
        "/var/www/html/arc-logs/:/arc/arc-logs/:rw", 
        "/etc/:/arc/etc/:rw",
        "/home/centos/.globus/:/arc/.globus/:ro",
        "/docker/arc/:/arc/arc-ce:rw",
        "/tmp/:/arc/tmp/:ro"]
        shm_size = 0

No experience here from others? I assume I am doing something wrong in the configuration of my volumes.

Hi,

Question 1:
When you create the container, with docker run or docker-compose, you can define the volumes

How did you create the container and with what parameters?

try the following:

docker inspect -f ‘{{ .Mounts }}’ containerid

Question 2:

Syntax:

“host-path: path-inside-container: mode”

In the .gitlab-ci.yml file, you must use path-inside-container

Hi,
thanks very much for your reply.

I just found out that all my problems were due to not actually using the correct gitlab-runner (gitlab runner token in my config.toml file was out of date). So the settings in the configuration were not picked up.

The way to mount the directories is correct.

Thanks a lot for replying, and sorry for the noise!
Maiken