1 # This is the tag of the docker image used for the build jobs. If the
2 # image doesn't exist yet, the containers-build stage generates it.
4 # In order to generate a new image, one should generally change the tag.
5 # While removing the image from the registry would also work, that's not
6 # recommended except for ephemeral images during development: Replacing
7 # an image after a significant amount of time might pull in newer
8 # versions of gcc/clang or other packages, which might break the build
9 # with older commits using the same tag.
11 # After merging a change resulting in generating a new image to the
12 # main repository, it's recommended to remove the image from the source
13 # repository's container registry, so that the image from the main
14 # repository's registry will be used there as well.
16 # The format of the tag is "%Y-%m-%d-${counter}" where ${counter} stays
17 # at "01" unless you have multiple updates on the same day :)
19 UBUNTU_TAG: 2019-01-31-01
20 UBUNTU_IMAGE: "$CI_REGISTRY/$CI_PROJECT_PATH/ubuntu:$UBUNTU_TAG"
30 stage: containers-build
35 DOCKER_HOST: tcp://docker:2375
36 DOCKER_DRIVER: overlay2
38 # Enable experimental features such as `docker manifest inspect`
40 - "echo '{\"experimental\": \"enabled\"}' > ~/.docker/config.json"
41 - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
42 # Check if the image (with the specific tag) already exists
43 - docker manifest inspect $UBUNTU_IMAGE && exit || true
44 - docker build -t $UBUNTU_IMAGE -f .gitlab-ci/Dockerfile.ubuntu .
45 - docker push $UBUNTU_IMAGE
49 - .gitlab-ci/Dockerfile.ubuntu