Mounting a volume with gitlab docker:dind services

Viewed 1102

I have an issue with gitlab runner using docker:dind service.

I'm trying to run a docker-compose file with simple volume on a job, here the job :


test_e2e:
  image: tmaier/docker-compose
  stage: test
  services:
    - docker:dind
  variables:
    GIT_STRATEGY: none
    GIT_CHECKOUT: "false"
    DOCKER_DRIVER: overlay2
  before_script:
    - ls
  script:
    - cp .env.dist .env
    - docker-compose -f docker-compose.yml -f docker-compose-ci.yml up -d

The job start normally but a container in docker-compose-ci.yml doesn't seem to mount the volume as specified in it, here docker-compose-ci.yml

version: '3.3'

services:
  wait_app:
    image: dadarek/wait-for-dependencies
    networks:
      - internal
    depends_on:
      - traefik
      - webapp
    command: webapp:3000
  cypress:
    # the Docker image to use from https://github.com/cypress-io/cypress-docker-images
    image: "cypress/included:6.5.0"
    networks:
      - internal
    depends_on:
      - traefik
      - webapp
      - api
      - mysql
      - redis
    environment:
      # pass base url to test pointing at the web application
      - CYPRESS_baseUrl=http://app.localhost:3000
    working_dir: /cypress
    volumes:
      - ./cypress/:/cypress

Here if I make an "docker exec app_cypress_1 sh -c "ls -al" || 1" of /cypress folder inside the container cypress, I will have nothing even though I do have files in there on the host.

But I tried on a different version of the runner 13.7.0 instead of 13.5.0, and it work as expected.

Where could be the issue ? Is it the gitlab runner are maybe there is another parameter that I can change to make it work ?

Thank you

0 Answers
Related