gitlab runner using wrong docker image for build container

docker containers gitlab gitlab-ci gitlab-ci-runner

1190 观看


129 作者的声誉

I set up an gitlab-ci-multi-runner on my VM.
In the build process I provide an docker container with all the dependencies. But when I run it, the runner uses a different (wrong) docker image for his build container.
The messages look like that:

Running with gitlab-ci-multi-runner 9.2.1 (f0xxxx4)
on runnerVM (f5xxxxf0)
Using Docker executor with image ...
Using docker image sha256:fe32xxx...xxxa63c for predefined container...
Pulling docker image ...
Using docker image ID=sha256:9608xxx...xxxdf09 for build container...

Can someone tell me why the runner uses a different docker image for build container?
Why is it not taking the predefined container (because that's the right one...)

Here you can see my gitlab-ci.yml:


  - echo "Before script"

  - echo "After Script"

  - build
  - test
  - deploy

  stage: build
    - sudo make all BUILD_TYPE=Release
    - master
    - tag1

  stage: build
    - sudo make all BUILD_TYPE=Debug
    - develop
    - runner-test
    - tag1
    - tag2
作者: npit 的来源 发布者: 2017 年 9 月 15 日

回应 (2)


1434 作者的声誉

In your .gitlab-ci.yml you are referencing the complete URL to your container; it should however be in the format group/container, e.g. library/nginx.

Optionally, you may use a specific version, e.g. library/nginx:1.13.9.

For more information, see:

作者: Philipp Ludwig 发布者: 27.02.2018 09:08


530 作者的声誉

I assume you are using the docker executor. Therefore the gitlab-ci-runner is creating a new Image gitlab/gitlab-runner-helper which will isolate the build-steps from your VM's docker-environment. This image shall be the predefined container.

The stages themself will be performed inside containers of images you specify for the job or the image you specify globally for all jobs. This container is the build container.

The build container should be made from the image you specify with image on top of your .gitlab-ci.yml. You can verify it by doing

$ docker image ls | grep -E '(fe32|9608)'

on your VM. It shows you the image names and tags of your predefined- and build-container.

作者: smoebody 发布者: 08.03.2018 03:21