docker-build:
  image: docker:latest
  stage: build
  services:
    - docker:dind
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - apk add bash git docker-compose
    - cp isardvdi.cfg.example isardvdi.cfg
    - echo "DOCKER_IMAGE_PREFIX=${CI_REGISTRY_IMAGE}/" >> isardvdi.cfg
    - echo "DOCKER_IMAGE_TAG=$CI_COMMIT_REF_SLUG" >> isardvdi.cfg
    - ./build.sh
    - docker-compose -f docker-compose.build.yml build
    - docker-compose -f docker-compose.video-standalone.build.yml build isard-video
    - docker-compose -f docker-compose.hypervisor.build.yml build isard-vpnc
    - docker-compose -f docker-compose.toolbox.build.yml build isard-toolbox
    - docker images --format="{{.Repository}}:{{.Tag}}" | grep "^$CI_REGISTRY_IMAGE/" | xargs -n1 docker push
  artifacts:
    paths:
      - docker-compose*.yml

docker-build:
  image: docker:latest
  stage: build
  services:
    - docker:dind
  before_script:
    - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
  script:
    - apk add bash git docker-compose
    # Use docker compose < 1.27 to avoid depends_on issue
    # https://github.com/isard-vdi/isard/issues/390
    - apk add py3-pip
    - pip install docker-compose~=1.26.0
    - cp isardvdi.cfg.example isardvdi.cfg
    - echo "DOCKER_IMAGE_PREFIX=${CI_REGISTRY_IMAGE}/" >> isardvdi.cfg
    - echo "DOCKER_IMAGE_TAG=$CI_COMMIT_REF_SLUG" >> isardvdi.cfg
    - ./build.sh
    - docker-compose -f docker-compose.build.yml build
    - docker-compose -f docker-compose.video-standalone.build.yml build isard-video
    - docker-compose -f docker-compose.hypervisor.build.yml build isard-vpnc
    - docker-compose -f docker-compose.toolbox.build.yml build isard-toolbox
    - docker images --format="{{.Repository}}:{{.Tag}}" | grep "^$CI_REGISTRY_IMAGE/" | xargs -n1 docker push
  artifacts:
    paths:
      - docker-compose*.yml

Fix docker-compose depends_on contains an invalid type issue
Fix docker-compose depends_on contains an invalid type issue

$ wget https://isardvdi.com/docker-compose.yml
$ docker-compose -v
docker-compose version 1.25.0, build unknown
$ docker-compose up
ERROR: The Compose file './docker-compose.yml' is invalid because:
services.isard-engine.depends_on contains an invalid type, it should be an array
