gitlab runner using wrong docker image for build container

docker containers gitlab gitlab-ci gitlab-ci-runner

1190 观看

2回复

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 docker.com/xxx/xxx/docker-build:stable ...
Using docker image sha256:fe32xxx...xxxa63c for predefined container...
Pulling docker image docker.com/xxx/xxx/docker-build:stable ...
Using docker image docker.com/xxx/xxx/docker-build:stable 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:

image: docker.com/xxx/xxx/docker-build:stable

before_script:
  - echo "Before script"


after_script:
  - echo "After Script"

stages:
  - build
  - test
  - deploy

build_release:
  stage: build
  script:
    - sudo make all BUILD_TYPE=Release
  only:
    - master
  tags:
    - tag1

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

回应 2


0

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: https://docs.gitlab.com/ce/ci/docker/using_docker_images.html

作者: Philipp Ludwig 发布者: 2018 年 2 月 27 日

0

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 发布者: 2018 年 3 月 8 日
32x32