image:fedora: stage: build image: docker:stable services: - docker:dind before_script: - docker info - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com script: - docker pull $CONTAINER_IMAGE:latest || true - docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest . - docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA - docker push $CONTAINER_IMAGE:latest variables: DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH/fedora image:ubuntu: stage: build image: docker:stable services: - docker:dind before_script: - docker info - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com script: - docker pull $CONTAINER_IMAGE:latest || true - docker build --cache-from $CONTAINER_IMAGE:latest --tag $CONTAINER_IMAGE:$CI_COMMIT_SHA --tag $CONTAINER_IMAGE:latest . - docker push $CONTAINER_IMAGE:$CI_COMMIT_SHA - docker push $CONTAINER_IMAGE:latest variables: DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH/ubuntu fedora: before_script: - apk add bash script: ./test.sh image: docker:stable services: - docker:dind variables: DETECTED_OS: fedora:29 DOCKER_IMAGE: cyplo/fedora29_base DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 dependencies: - image:fedora ubuntu: before_script: - apk add bash script: ./test.sh image: docker:stable services: - docker:dind variables: DETECTED_OS: ubuntu:cosmic DOCKER_IMAGE: cyplo/cosmic_base DOCKER_HOST: tcp://docker:2375/ DOCKER_DRIVER: overlay2 dependencies: - image:ubuntu