0

I'm trying to start multiple docker containers with a wsl shell runner. After running

compose_job:
  tags:
   - wsl
  stage: compose
  script:
    - cd /pathToComposeFile
    - docker-compose up
  dependencies:
    - pull_job

the runner excited with following error:

$ docker-compose up
docker: invalid reference format: repository name must be lowercase.

the docker-compose.yml is:

version: '3'

services:
  cron:
    build: cron/.
    container_name: cron
    image: cron_image
    ports:
      - 6040:6040

The referenced images are all written in lowercase and the same command excited as expected if run manually. I already checked that docker-compose is accessible and that the docker-compose.yml is readable. How can I resolve this issue? Thank you in advance!

  • Can you show file docker-compose.yml? – quoc9x Nov 25 '21 at 12:45
  • Of course, I edited the Question. – Jan-Timo Hesse Nov 25 '21 at 12:51
  • Does this [answer](https://stackoverflow.com/questions/48522615/docker-error-invalid-reference-format-repository-name-must-be-lowercase) help? – DV82XL Nov 25 '21 at 13:00
  • @DV82XL Unfortanetly the answer doesn't apply to my case as I'm not using any upper case. I also changed the docker-compose.yml to a minimal example. – Jan-Timo Hesse Nov 25 '21 at 15:04
  • Why do you want to use docker-compose up in your pipeline instead of gitlab services? Do you need your API running or something, or some DB to be up? If that is the case see the following answer: https://stackoverflow.com/questions/66071016/how-to-setup-gitlab-ci-e2e-tests-using-multiple-dockers/69955434#69955434. Anyway I do not see a single use case for docker-compose, so I would strongly suggest to use gitlab services instead: https://docs.gitlab.com/ee/ci/services/ – Robert-Jan Kuyper Nov 25 '21 at 15:07
  • Thank you for your comment @Robert-JanKuyper. I need to use docker-compose, because the container can only be build and used on the server. Also docker in docker can not be used as I need to access specific network ips, which can't be accessed inside a nested container. Maybe it sounds a bit weird, but I already tried this. – Jan-Timo Hesse Nov 25 '21 at 15:31

1 Answers1

0

I think service_name, container_name and env must be lowercase. Look like

version: '3'

services:
  perihubapi:
    build:
      context: api/.
      args: 
        EXTERNAL: ${external}
        FASERVICES: ${faservices}
    container_name: perihubapi
    image: peri_hub_api_image
    ports:
      - 6020:6020
    networks:
      - backend
    volumes:
      - peridigm_volume:/app/peridigmJobs
      - paraView_volume:/app/paraView
      - secrets:/app/certs

  perihubgui:
    build: gui/.
    container_name: perihubgui
    image: peri_hub_gui_image
    ports:
      - 6010:6010
    networks:
      - backend
    volumes:
      - secrets:/app/certs

  peridigm:
    build: 
      context: peridigm/.
      args: 
        GITLAB_USER: ${gitlab_user}
        GITLAB_TOKEN: ${gitlab_token}
        PERIDOX: ${peridox}
    container_name: peridigm
    image: peridigm_image
    ports:
      - 6030:6030
    networks:
      - backend
    volumes:
      - peridigm_volume:/app/peridigmJobs

  paraview:
    build: 
      context: paraview/.
    container_name: paraview
    image: paraview_image
    volumes:
      - paraView_volume:/app/paraView

  cron:
    build: cron/.
    container_name: cron
    image: cron_image
    ports:
      - 6040:6040
    networks:
      - backend
  
networks:
  backend:
    driver: bridge

volumes:
  peridigm_volume:
  paraView_volume:
  secrets:
    external: true
quoc9x
  • 1,423
  • 2
  • 9
  • 26