Skip to content

Publish helper images to registry.gitlab.com

Steve Xuereb requested to merge 27196-publish-gitlab-registry into master

What does this MR do?

Publish helper images to registry.gitlab.com

Why was this MR needed?

With the new DockerHub limits users are reaching limits because they are pulling gitlab/gitlab-runner-helper image from DockerHub registry.

Start publishing the helper image to the GitLab.com registry to provide an alternative hosting of the helper image.

What's the best way to test this MR?

Publish GitLab Runner images to registry.gitlab.com Linux

  1. Build helper binary: make helper-bin
  2. Build docker image: make helper-dockerarchive
  3. Build gitlab-runner: make runner-bin BUILD_PLATFORMS="-osarch='linux/amd64'"
  4. Build deb packages for gitlab-runner: make package-deb-arch ARCH=amd64 PACKAGE_ARCH=amd64 RUNNER_BINARY=out/binaries/gitlab-runner-linux-amd64
  5. Run CI_REGISTRY=registry.gitlab.com PUBLISH_IMAGES=true CI_REGISTRY_IMAGE=registry.gitlab.com/steveazz/playground CI_REGISTRY_PASSWORD=xxxx CI_REGISTRY_USER=xxxx TARGET_ARCHS=amd64 IS_LATEST=true ./ci/release_docker_images. Notice that I set CI_REGISTRY_IMAGE to steveazz/playground so that I push to my own namespace. CI_REGISTRY_PASSWORD should be a PAT token to be able to push to the registry.
  6. Check that the helper image is in the registry
example of build logs
amd64:
Building and pushing image: dockerfiles/runner/ubuntu
docker-buildx
Successfully created context "docker-buildx"
buildx-builder
Login Succeeded
[+] Building 517.2s (12/12) FINISHED
 => [internal] booting buildkit                                                                                                                                                                                                                                                               84.2s
 => => pulling image moby/buildkit:buildx-stable-1                                                                                                                                                                                                                                            83.4s
 => => creating container buildx_buildkit_buildx-builder0                                                                                                                                                                                                                                      0.8s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                              0.1s
 => => transferring context: 2B                                                                                                                                                                                                                                                                0.0s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                           0.1s
 => => transferring dockerfile: 899B                                                                                                                                                                                                                                                           0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                                                                                                                                                                                                                                6.0s
 => [1/6] FROM docker.io/library/ubuntu:20.04@sha256:fff16eea1a8ae92867721d90c59a75652ea66d29c05294e6e2f898704bdb8cf1                                                                                                                                                                          8.3s
 => => resolve docker.io/library/ubuntu:20.04@sha256:fff16eea1a8ae92867721d90c59a75652ea66d29c05294e6e2f898704bdb8cf1                                                                                                                                                                          0.0s
 => => sha256:fff16eea1a8ae92867721d90c59a75652ea66d29c05294e6e2f898704bdb8cf1 1.20kB / 1.20kB                                                                                                                                                                                                 0.0s
 => => sha256:1d7b639619bdca2d008eca2d5293e3c43ff84cbee597ff76de3b7a7de3e84956 943B / 943B                                                                                                                                                                                                     0.0s
 => => sha256:a254829d9e55168306fd80a49e02eb015551facee9c444d9dce3b26d19238b82 162B / 162B                                                                                                                                                                                                     2.2s
 => => sha256:6a5697faee43339ef8e33e3839060252392ad99325a48f7c9d7e93c22db4d4cf 28.56MB / 28.56MB                                                                                                                                                                                               3.8s
 => => sha256:d70eaf7277eada08fca944de400e7e4dd97b1262c06ed2b1011500caa4decaf1 3.35kB / 3.35kB                                                                                                                                                                                                 0.0s
 => => sha256:ba13d3bc422b493440f97a8f148d245e1999cb616cb05876edc3ef29e79852f2 847B / 847B                                                                                                                                                                                                     2.3s
 => => unpacking docker.io/library/ubuntu:20.04@sha256:fff16eea1a8ae92867721d90c59a75652ea66d29c05294e6e2f898704bdb8cf1                                                                                                                                                                        2.4s
 => [internal] load build context                                                                                                                                                                                                                                                              6.7s
 => => transferring context: 146.20MB                                                                                                                                                                                                                                                          6.7s
 => [2/6] RUN apt-get update -y &&     apt-get install -y --no-install-recommends         apt-transport-https         ca-certificates         curl         git         wget         tzdata         openssh-client     && rm -rf /var/lib/apt/lists/*                                          19.3s
 => [3/6] COPY gitlab-runner_*.deb checksums-* install-deps install-gitlab-runner /tmp/                                                                                                                                                                                                        0.8s
 => [4/6] RUN /tmp/install-deps "linux/amd64" "0.16.2" "1.2.2" "2.11.0"                                                                                                                                                                                                                       41.3s
 => [5/6] COPY entrypoint /                                                                                                                                                                                                                                                                    0.0s
 => [6/6] RUN chmod +x /entrypoint                                                                                                                                                                                                                                                             0.1s
 => exporting to image                                                                                                                                                                                                                                                                       356.9s
 => => exporting layers                                                                                                                                                                                                                                                                       15.8s
 => => exporting manifest sha256:ca53a6e86af380192d678fefc3e08ea05b6505c031ae3ed06bae30c2f76e4713                                                                                                                                                                                              0.0s
 => => exporting config sha256:89cd35c17b67ee2438366edd23823067dca4fbd29f611588c4c04a5921ceef97                                                                                                                                                                                                0.0s
 => => pushing layers                                                                                                                                                                                                                                                                          2.5s
 => => pushing manifest for registry.gitlab.com/steveazz/playground:ubuntu-bleeding                                                                                                                                                                                                            2.9s
 => => pushing manifest for registry.gitlab.com/steveazz/playground:bleeding                                                                                                                                                                                                                   2.5s
 => => pushing manifest for registry.gitlab.com/steveazz/playground:ubuntu                                                                                                                                                                                                                     2.4s
 => => pushing manifest for registry.gitlab.com/steveazz/playground:latest                                                                                                                                                                                                                     2.3s
Removing login credentials for registry.gitlab.com
Building and pushing image: dockerfiles/runner/alpine
docker-buildx
Successfully created context "docker-buildx"
buildx-builder
Login Succeeded
[+] Building 155.2s (14/14) FINISHED
 => [internal] booting buildkit                                                                                                                                                                                                                                                               18.5s
 => => pulling image moby/buildkit:buildx-stable-1                                                                                                                                                                                                                                            17.7s
 => => creating container buildx_buildkit_buildx-builder0                                                                                                                                                                                                                                      0.8s
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                           0.0s
 => => transferring dockerfile: 937B                                                                                                                                                                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                              0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                0.0s
 => [internal] load metadata for docker.io/library/alpine:3.12.0                                                                                                                                                                                                                               5.7s
 => [1/8] FROM docker.io/library/alpine:3.12.0@sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321                                                                                                                                                                         5.6s
 => => resolve docker.io/library/alpine:3.12.0@sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321                                                                                                                                                                         0.0s
 => => sha256:df20fa9351a15782c64e6dddb2d4a6f50bf6d3688060a34c4014b0d9a752eb4c 2.80MB / 2.80MB                                                                                                                                                                                                 2.5s
 => => sha256:a24bb4013296f61e89ba57005a7b3e52274d8edd3ae2077d04395f806b63d83e 1.51kB / 1.51kB                                                                                                                                                                                                 0.0s
 => => sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321 1.64kB / 1.64kB                                                                                                                                                                                                 0.0s
 => => sha256:a15790640a6690aa1730c38cf0a440e2aa44aaca9b0e8931a9f2b0d7cc90fd65 528B / 528B                                                                                                                                                                                                     0.0s
 => => unpacking docker.io/library/alpine:3.12.0@sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321                                                                                                                                                                       0.5s
 => [internal] load build context                                                                                                                                                                                                                                                              5.4s
 => => transferring context: 103.65MB                                                                                                                                                                                                                                                          5.4s
 => [2/8] RUN adduser -D -S -h /home/gitlab-runner gitlab-runner                                                                                                                                                                                                                               0.4s
 => [3/8] RUN apk add --no-cache     bash     ca-certificates     git     tzdata     openssh-client                                                                                                                                                                                            6.9s
 => [4/8] COPY gitlab-runner-linux-* /usr/bin/                                                                                                                                                                                                                                                 0.5s
 => [5/8] COPY checksums-* install-deps install-gitlab-runner /tmp/                                                                                                                                                                                                                            0.0s
 => [6/8] RUN apk add --no-cache --virtual .fetch-deps wget &&     /tmp/install-deps "linux/amd64" "0.16.2" "1.2.2" "2.11.0" &&     apk del .fetch-deps                                                                                                                                       14.6s
 => [7/8] COPY entrypoint /                                                                                                                                                                                                                                                                    0.0s
 => [8/8] RUN chmod +x /entrypoint                                                                                                                                                                                                                                                             0.1s
 => exporting to image                                                                                                                                                                                                                                                                       102.6s
 => => exporting layers                                                                                                                                                                                                                                                                       11.3s
 => => exporting manifest sha256:14f49c96e0822a73bdc63ed154b8bc01e9f2f396cec1c23c46df57259ef14460                                                                                                                                                                                              0.0s
 => => exporting config sha256:3cf9ed8792408467c46eeb33cb54fa3d5e9fe8b5da1c02d07f2ffa97ed913f2b                                                                                                                                                                                                0.0s
 => => pushing layers                                                                                                                                                                                                                                                                          2.7s
 => => pushing manifest for registry.gitlab.com/steveazz/playground:alpine-bleeding                                                                                                                                                                                                            2.8s
 => => pushing manifest for registry.gitlab.com/steveazz/playground:alpine                                                                                                                                                                                                                     2.6s
Removing login credentials for registry.gitlab.com
Login Succeeded
Importing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-6834fb73
sha256:0eba1e36ad2689c9778e4330a58298f1dd8aa278d660ab04fac4e103666b060d
Importing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm-6834fb73
sha256:94df32d88fca755ea0ea90f124e484e6d63617f1d694c9ac5546b25f623afe40
Importing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm64-6834fb73
sha256:cfe57649e98d99a0fe1ee3f5bb0b5f57d3b201e1cbbf35a7496fcd4486d99d88
Importing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:s390x-6834fb73
sha256:9cba7bd4ecb60f2e5c36e48c817d6a2365d798d7cbddea2de1518d258b474b0d
Tagging image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-latest
Tagging image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm-latest
Tagging image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm64-latest
Tagging image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:s390x-latest
Tagging image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-bleeding
Tagging image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm-bleeding
Tagging image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm64-bleeding
Tagging image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:s390x-bleeding
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-6834fb73
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
e431077f867a: Layer already exists
x86_64-6834fb73: digest: sha256:28dfe604f66c3ec8c290c5dc3b71c00d21f1161a4bbca6a16ed917e56491c53a size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm-6834fb73
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
626a47892402: Layer already exists
arm-6834fb73: digest: sha256:be4c96eb586865a5db834b9a96ebd5b35c2924722cba2c09a4706415a28b3d75 size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm64-6834fb73
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
db357f8fe537: Layer already exists
arm64-6834fb73: digest: sha256:36a67a0137746cb84c556e77f2da1d8816896d44dd3f73c93976efd2395fea42 size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:s390x-6834fb73
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
0fadd130040f: Layer already exists
s390x-6834fb73: digest: sha256:0400abee372e9d69f646b74e577d9b5bd9cc130700c2cdcc5607c7fc6cbb9063 size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-latest
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
e431077f867a: Layer already exists
x86_64-latest: digest: sha256:28dfe604f66c3ec8c290c5dc3b71c00d21f1161a4bbca6a16ed917e56491c53a size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm-latest
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
626a47892402: Layer already exists
arm-latest: digest: sha256:be4c96eb586865a5db834b9a96ebd5b35c2924722cba2c09a4706415a28b3d75 size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm64-latest
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
db357f8fe537: Layer already exists
arm64-latest: digest: sha256:36a67a0137746cb84c556e77f2da1d8816896d44dd3f73c93976efd2395fea42 size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:s390x-latest
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
0fadd130040f: Layer already exists
s390x-latest: digest: sha256:0400abee372e9d69f646b74e577d9b5bd9cc130700c2cdcc5607c7fc6cbb9063 size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-bleeding
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
e431077f867a: Layer already exists
x86_64-bleeding: digest: sha256:28dfe604f66c3ec8c290c5dc3b71c00d21f1161a4bbca6a16ed917e56491c53a size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm-bleeding
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
626a47892402: Layer already exists
arm-bleeding: digest: sha256:be4c96eb586865a5db834b9a96ebd5b35c2924722cba2c09a4706415a28b3d75 size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:arm64-bleeding
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
db357f8fe537: Layer already exists
arm64-bleeding: digest: sha256:36a67a0137746cb84c556e77f2da1d8816896d44dd3f73c93976efd2395fea42 size: 528
Pushing image: registry.gitlab.com/steveazz/playground/gitlab-runner-helper:s390x-bleeding
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
0fadd130040f: Layer already exists
s390x-bleeding: digest: sha256:0400abee372e9d69f646b74e577d9b5bd9cc130700c2cdcc5607c7fc6cbb9063 size: 528
Removing login credentials for registry.gitlab.com
Skipping push to Docker Hub

Publish GitLab Runner images to DockerHub Linux

  1. Using the binaries build from the previous step
  2. Run env PUSH_TO_DOCKER_HUB=true DOCKER_HUB_USER=steveazzgitlab DOCKER_HUB_PASSWORD=xxxxxxxx DOCKER_HUB_NAMESPACE=steveazzgitlab TARGET_ARCHS=amd64 PUBLISH_IMAGES=true IS_LATEST=true ./ci/release_docker_images. Notice how DOCKER_HUB_NAMESPACE is set to steveazgitlabz so that we publish the helper image under the steveazzgitlab namespace instead of the gitlab one for development/testing
  3. Check that the helper image is in the registry

Publish images to registry.gitlab.com Windows

  1. Start your Windows environment. Note at the moment there is a [problem with the vagrant machine](

  2. Set up the correct variables to build image

    powershell
    Set-Item -Path env:CI_REGISTRY_PASSWORD -Value xxx
    Set-Item -Path env:CI_REGISTRY_USER -Value xxx
    Set-Item -Path env:DOCKER_HUB_USER -Value xxx
    Set-Item -Path env:DOCKER_HUB_PASSWORD -Value xxx
    Set-Item -Path env:DOCKER_HUB_PASSWORD -Value xxx
    Set-Item -Path env:DOCKER_HUB_NAMESPACE -Value steveazzgitlab # Override the default `gitlab` namespace for development
    Set-Item -Path env:PUBLISH_IMAGES -Value true
    Set-Item -Path env:PUSH_TO_DOCKER_HUB -Value true
    Set-Item -Path env:GIT_VERSION_BUILD -Value 1
    Set-Item -Path env:GIT_VERSION -Value 2.27.0
    Set-Item -Path env:CI_REGISTRY -Value registry.gitlab.com
    Set-Item -Path env:CI_REGISTRY_IMAGE -Value registry.gitlab.com/steveazz/playground  # Notice the image is `/steveazz/playground` on purpose so I don't push to `gitlab-org/gitlab-runner`
    Set-Item -Path env:GIT_256_CHECKSUM -Value bdb8c1560eca39f4d99b07705006c00d94a3f8612501046a0f89353afc5307fa
    Set-Item -Path env:GIT_LFS_256_CHECKSUM -Value ca05b0b9bd39d99665045776a5d0d5c7bfa2605a6118c2f489bfd40c2c3e4f2c
    Set-Item -Path env:GIT_LFS_VERSION -Value 2.11.0
    Set-Item -Path env:SKIP_CLEANUP -Value true
    Set-Item -Path env:WINDOWS_VERSION -Value servercore1809
    Set-Item -Path env:WINDOWS_VERSION -Value servercore1809
  3. Build the image .\ci\build_release_windows_images.ps1

  4. Images are published in both registries

example log
PS C:\Users\Administrator\Downloads\gitlab-runner> .\ci\build_release_windows_images.ps1
Build image for x86_64_servercore1809


    Directory: C:\Users\Administrator\Downloads\gitlab-runner\dockerfiles\runner-helper

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           11/6/2020  1:24 AM                binaries
Sending build context to Docker daemon  42.47MB
Step 1/23 : ARG BASE_IMAGE_TAG
Step 2/23 : FROM ${BASE_IMAGE_TAG} as builder
 ---> 7d93ed91404f
Step 3/23 : SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
 ---> Running in f9877cb5c1a8
Removing intermediate container f9877cb5c1a8
 ---> e3952804eb2f
Step 4/23 : ARG GIT_VERSION
 ---> Running in 4d123ea6fe03
Removing intermediate container 4d123ea6fe03
 ---> f16f37b57353
Step 5/23 : ARG GIT_VERSION_BUILD
 ---> Running in 239f5fe62fae
Removing intermediate container 239f5fe62fae
 ---> af83d41ad9c5
Step 6/23 : ARG GIT_256_CHECKSUM
 ---> Running in db7db9ad4f4a
Removing intermediate container db7db9ad4f4a
 ---> e77817dd021a
Step 7/23 : ARG GIT_LFS_VERSION
 ---> Running in 63900ce61b80
Removing intermediate container 63900ce61b80
 ---> 65a1cb13f1b6
Step 8/23 : ARG GIT_LFS_256_CHECKSUM
 ---> Running in 818af33e94d7
Removing intermediate container 818af33e94d7
 ---> a944011be36e
Step 9/23 : RUN [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12;     Invoke-Webrequest "https://github.com/git-for-windows/git/releases/download/v${Env:GIT_VERSION}.windows.${Env:GIT_VERSION_BUILD}/MinGit-${Env:GIT_VERSION}-64-bit.zip" -OutFile git.zip -UseBasicParsing;     Invoke-Webrequest "https://github.com/git-lfs/git-lfs/releases/download/v${Env:GIT_LFS_VERSION}/git-lfs-windows-amd64-v${Env:GIT_LFS_VERSION}.zip" -OutFile git-lfs.zip -UseBasicParsing
 ---> Running in 159b5a7f153e
Removing intermediate container 159b5a7f153e
 ---> 87e8abaf4b41
Step 10/23 : COPY [".\\helpers\\checksum.ps1", ".\\"]
 ---> 17e608c36064
Step 11/23 : RUN powershell -File .\checksum.ps1 -TargetFile git.zip -ExpectedHash ${Env:GIT_256_CHECKSUM}
 ---> Running in a8171d4b8999
SHA256 checksum for git.zip is valid
Removing intermediate container a8171d4b8999
 ---> 21836a872974
Step 12/23 : RUN powershell -File .\checksum.ps1 -TargetFile git-lfs.zip -ExpectedHash ${Env:GIT_LFS_256_CHECKSUM}
 ---> Running in a4d0b44afeba
SHA256 checksum for git-lfs.zip is valid
Removing intermediate container a4d0b44afeba
 ---> f2b91eedbaa6
Step 13/23 : RUN New-Item -ItemType directory -Path C:\Temp
 ---> Running in a49e6563d4dc


    Directory: C:\


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        11/6/2020   1:27 AM                Temp


Removing intermediate container a49e6563d4dc
 ---> eb5a3af056a7
Step 14/23 : RUN Expand-Archive -Path git.zip -DestinationPath C:\Temp\git
 ---> Running in 5f6df1480c35
Removing intermediate container 5f6df1480c35
 ---> 5173cfd639b8
Step 15/23 : RUN Expand-Archive -Path git-lfs.zip -DestinationPath C:\Temp\git-lfs
 ---> Running in f2f4a6fdb77c
Removing intermediate container f2f4a6fdb77c
 ---> 0c296cd1030f
Step 16/23 : COPY [".\\binaries\\gitlab-runner-helper.x86_64-windows.exe", "C:\\Temp\\gitlab-runner-helper\\gitlab-runner-helper.exe"]
 ---> db09c621e6b5
Step 17/23 : FROM ${BASE_IMAGE_TAG}
 ---> 7d93ed91404f
Step 18/23 : USER ContainerAdministrator
 ---> Running in de6c09267ca8
Removing intermediate container de6c09267ca8
 ---> 9c1525f4b61e
Step 19/23 : SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
 ---> Running in 471c1832de45
Removing intermediate container 471c1832de45
 ---> b4bb2fd9243f
Step 20/23 : COPY --from=builder ["C:\\Temp", "C:\\Program Files\\"]
 ---> e0ef45ad893d
Step 21/23 : RUN [Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\Program Files\git\cmd;C:\Program Files\git-lfs;C:\Program Files\gitlab-runner-helper', [EnvironmentVariableTarget]::Machine);     $env:Path = [System.Environment]::GetEnvironmentVariable('Path', 'Machine');     $env:GIT_CONFIG_NOSYSTEM=1;     & $env:ProgramFiles\git\cmd\git.exe config --system --unset-all include.path;     & $env:ProgramFiles\git\cmd\git.exe config --system core.longpaths true;     & $env:ProgramFiles\git\cmd\git.exe lfs install --skip-repo;
 ---> Running in ef318267fd85
Git LFS initialized.
Removing intermediate container ef318267fd85
 ---> 8c689986f2f3
Step 22/23 : COPY [".\\helpers\\entrypoint.cmd", ".\\"]
 ---> d7b9941d4fbe
Step 23/23 : ENTRYPOINT ["entrypoint.cmd"]
 ---> Running in 55a463c1702d
Removing intermediate container 55a463c1702d
 ---> cea6acc37a2a
Successfully built cea6acc37a2a
Successfully tagged steveazzgitlab/gitlab-runner-helper:x86_64-6834fb73-servercore1809
Successfully tagged registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-6834fb73-servercore1809
here
Login registry $registry
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in C:\Users\Administrator\.docker\config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
Push x86_64-6834fb73-servercore1809
The push refers to repository [docker.io/steveazzgitlab/gitlab-runner-helper]
296621c4cb6d: Pushed
9d276027df69: Pushed
e6b2001756df: Pushed
c58599726f17: Pushed
aa8af9e1ad4a: Pushed
2d08160b8b46: Pushed
298c411d5557: Skipped foreign layer
a7ba3db29ebb: Skipped foreign layer
x86_64-6834fb73-servercore1809: digest: sha256:80445a26f94931884562f4c87ea0371c89f73e7c0f0712b966b1ae0cd16d1e09 size: 2356
Tag x86_64-6834fb73-servercore1809 as latest
Push latest tag
The push refers to repository [docker.io/steveazzgitlab/gitlab-runner-helper]
296621c4cb6d: Layer already exists
9d276027df69: Layer already exists
e6b2001756df: Layer already exists
c58599726f17: Layer already exists
aa8af9e1ad4a: Layer already exists
2d08160b8b46: Layer already exists
298c411d5557: Skipped foreign layer
a7ba3db29ebb: Skipped foreign layer
x86_64-latest-servercore1809: digest: sha256:80445a26f94931884562f4c87ea0371c89f73e7c0f0712b966b1ae0cd16d1e09 size: 2356
Logout registry $registry
Removing login credentials for https://index.docker.io/v1/
Login registry $registry
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in C:\Users\Administrator\.docker\config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
Push x86_64-6834fb73-servercore1809
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
296621c4cb6d: Pushed
9d276027df69: Pushed
e6b2001756df: Pushed
c58599726f17: Pushed
aa8af9e1ad4a: Pushed
2d08160b8b46: Pushed
298c411d5557: Skipped foreign layer
a7ba3db29ebb: Skipped foreign layer
x86_64-6834fb73-servercore1809: digest: sha256:80445a26f94931884562f4c87ea0371c89f73e7c0f0712b966b1ae0cd16d1e09 size: 2356
Tag x86_64-6834fb73-servercore1809 as latest
Push latest tag
The push refers to repository [registry.gitlab.com/steveazz/playground/gitlab-runner-helper]
296621c4cb6d: Layer already exists
9d276027df69: Layer already exists
e6b2001756df: Layer already exists
c58599726f17: Layer already exists
aa8af9e1ad4a: Layer already exists
2d08160b8b46: Layer already exists
298c411d5557: Skipped foreign layer
a7ba3db29ebb: Skipped foreign layer
x86_64-latest-servercore1809: digest: sha256:80445a26f94931884562f4c87ea0371c89f73e7c0f0712b966b1ae0cd16d1e09 size: 2356
Logout registry $registry
Removing login credentials for registry.gitlab.com

Run CI job using helper image hosted in registry.gitlab.com Linux

  1. Override the helper image to specify the registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-latest image

    config.toml
    [[runners]]
      name = "docker"
      url = "http://192.168.1.79:3000/"
      token = "xxxxxx"
      executor = "docker"
      [runners.docker]
        tls_verify = false
        image = "alpine:3.12"
        privileged = true
        disable_entrypoint_overwrite = false
        oom_kill_disable = false
        disable_cache = false
        volumes = ["/cache", "/certs/client", "/tmp/daemon.json:/etc/docker/daemon.json:ro"]
        pull_policy = "if-not-present"
        shm_size = 0
        helper_image = "registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-latest"
  2. Run ci job

    .gitlab-ci.yml
    job:
      before_script:
      - echo "before_script"
      - echo $CI_JOB_STATUS
      script:
      - echo "hello"
      - echo $CI_JOB_STATUS
      after_script:
      - echo "after script"
      - echo $CI_JOB_STATUS

Run CI job using helper image hosted in registry.gitlab.com Windows

  1. Override the helper image to specify the registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-latest-servercore1809 image

    config.toml
    [[runners]]
      name = "docker-windows"
      url = "http://192.168.1.79:3000/"
      token = "3rRLwAVsJGfdzKz6vqaT"
      executor = "docker-windows"
      [runners.docker]
        tls_verify = false
        image = "mcr.microsoft.com/windows/servercore:1809-amd64"
        disable_entrypoint_overwrite = false
        oom_kill_disable = false
        disable_cache = false
        volumes = ["C:\\cache"]
        pull_policy = "if-not-present"
        helper_image = "registry.gitlab.com/steveazz/playground/gitlab-runner-helper:x86_64-latest-servercore1809"
        ```
    </details>
  2. Run ci job

    .gitlab-ci.yml
    job:
      before_script:
      - echo "before_script"
      - echo $CI_JOB_STATUS
      script:
      - echo "hello"
      - echo $CI_JOB_STATUS
      after_script:
      - echo "after script"
      - echo $CI_JOB_STATUS

What are the relevant issue numbers?

Phase 1 of #27196 (closed)

Edited by Steve Xuereb

Merge request reports