简体   繁体   中英

Gitlab CI shell runner fails with docker-compose up

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM