Make runner-and-helper-docker-host ignores host arch for helper docker
Summary
When building the docker images runner and helper for the the current host, the make ignores the host arch and tries to build all helper docker images.
Steps to reproduce
- clone gitlab-runner repository
- start make runner and helper docker images for the current host:
make runner-and-helper-docker-host
Actual behavior
The make runner-and-helper-docker-host
on a Linux x86_64 host is failing while trying to build the helper docker image for Linux arm.
Expected behavior
The make runner-and-helper-docker-host
on a Linux x86_64 host should build only the helper docker image for the current host.
Relevant logs and/or screenshots
make build log
# make runner-and-helper-docker-host
make runner-bin BUILD_PLATFORMS="-os='linux' -arch 'amd64'"
make[1]: Entering directory '/home/vlad/work/gitlab/icono1/gitlab-runner'
go get github.com/mitchellh/gox
# Building gitlab-runner in version 13.5.0~beta.55.g6f788059 for -os='linux' -arch 'amd64'
gox -os='linux' -arch 'amd64' \
-ldflags "-X gitlab.com/gitlab-org/gitlab-runner/common.NAME=gitlab-runner -X gitlab.com/gitlab-org/gitlab-runner/common.VERSION=13.5.0~beta.55.g6f788059 -X gitlab.com/gitlab-org/gitlab-runner/common.REVISION=6f788059 -X gitlab.com/gitlab-org/gitlab-runner/common.BUILT=2020-09-24T16:23:29+0000 -X gitlab.com/gitlab-org/gitlab-runner/common.BRANCH=feature/runners_allowPrivilegeEscalation -s -w" \
-output="out/binaries/gitlab-runner-{{.OS}}-{{.Arch}}" \
gitlab.com/gitlab-org/gitlab-runner
Number of parallel builds: 15
--> linux/amd64: gitlab.com/gitlab-org/gitlab-runner
make[1]: Leaving directory '/home/vlad/work/gitlab/icono1/gitlab-runner'
go get github.com/mitchellh/gox
gox -osarch=linux/amd64 -ldflags "-X gitlab.com/gitlab-org/gitlab-runner/common.NAME=gitlab-runner -X gitlab.com/gitlab-org/gitlab-runner/common.VERSION=13.5.0~beta.55.g6f788059 -X gitlab.com/gitlab-org/gitlab-runner/common.REVISION=6f788059 -X gitlab.com/gitlab-org/gitlab-runner/common.BUILT=2020-09-24T16:23:29+0000 -X gitlab.com/gitlab-org/gitlab-runner/common.BRANCH=feature/runners_allowPrivilegeEscalation -s -w" -output=out/binaries/gitlab-runner-helper/gitlab-runner-helper.x86_64 gitlab.com/gitlab-org/gitlab-runner/apps/gitlab-runner-helper
Number of parallel builds: 15
--> linux/amd64: gitlab.com/gitlab-org/gitlab-runner/apps/gitlab-runner-helper
Building helper image for: linux/amd64
docker-buildx
Successfully created context "docker-buildx"
buildx-builder
WARN[0000] invalid non-bool value for BUILDX_NO_DEFAULT_LOAD:
[+] Building 19.3s (14/14) FINISHED
=> [internal] booting buildkit 2.5s
=> => pulling image moby/buildkit:buildx-stable-1 1.9s
=> => creating container buildx_buildkit_buildx-builder0 0.5s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 981B 0.0s
=> [internal] load metadata for docker.io/library/alpine:3.12.0 4.8s
=> [1/8] FROM docker.io/library/alpine:3.12.0@sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321 4.3s
=> => resolve docker.io/library/alpine:3.12.0@sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321 0.0s
=> => sha256:a24bb4013296f61e89ba57005a7b3e52274d8edd3ae2077d04395f806b63d83e 1.51kB / 1.51kB 0.0s
=> => sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321 1.64kB / 1.64kB 0.0s
=> => sha256:a15790640a6690aa1730c38cf0a440e2aa44aaca9b0e8931a9f2b0d7cc90fd65 528B / 528B 0.0s
=> => sha256:df20fa9351a15782c64e6dddb2d4a6f50bf6d3688060a34c4014b0d9a752eb4c 2.80MB / 2.80MB 2.6s
=> => unpacking docker.io/library/alpine:3.12.0@sha256:185518070891758909c9f839cf4ca393ee977ac378609f700f60a771a2dfe321 0.2s
=> [internal] load build context 0.1s
=> => transferring context: 17.49MB 0.1s
=> [2/8] RUN apk add --no-cache bash ca-certificates dumb-init git git-lfs miniperl && ln -s miniperl /usr/bin/perl 6.7s
=> [3/8] RUN git lfs install --skip-repo 0.2s
=> [4/8] COPY ./helpers/entrypoint / 0.0s
=> [5/8] RUN chmod +x /entrypoint 0.1s
=> [6/8] COPY ./scripts/ /usr/bin 0.0s
=> [7/8] COPY ./gitlab-runner-helper /usr/bin/ 0.1s
=> [8/8] RUN echo 'hosts: files dns' >> /etc/nsswitch.conf 0.1s
=> exporting to client 0.2s
=> => sending tarball 0.2s
xz -f -9 out/helper-images/prebuilt-x86_64.tar
gox -osarch=linux/arm -ldflags "-X gitlab.com/gitlab-org/gitlab-runner/common.NAME=gitlab-runner -X gitlab.com/gitlab-org/gitlab-runner/common.VERSION=13.5.0~beta.55.g6f788059 -X gitlab.com/gitlab-org/gitlab-runner/common.REVISION=6f788059 -X gitlab.com/gitlab-org/gitlab-runner/common.BUILT=2020-09-24T16:23:29+0000 -X gitlab.com/gitlab-org/gitlab-runner/common.BRANCH=feature/runners_allowPrivilegeEscalation -s -w" -output=out/binaries/gitlab-runner-helper/gitlab-runner-helper.arm gitlab.com/gitlab-org/gitlab-runner/apps/gitlab-runner-helper
Number of parallel builds: 15
--> linux/arm: gitlab.com/gitlab-org/gitlab-runner/apps/gitlab-runner-helper
Building helper image for: linux/arm
docker-buildx
Successfully created context "docker-buildx"
buildx-builder
WARN[0000] invalid non-bool value for BUILDX_NO_DEFAULT_LOAD:
[+] Building 7.4s (4/4) FINISHED
=> [internal] booting buildkit 2.9s
=> => pulling image moby/buildkit:buildx-stable-1 2.2s
=> => creating container buildx_buildkit_buildx-builder0 0.6s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 981B 0.0s
=> [internal] load metadata for docker.io/library/alpine:3.12.0 4.4s
failed to solve: rpc error: code = Unknown desc = failed to load LLB: runtime execution on platform linux/arm/v7 not supported
make: *** [Makefile.runner_helper.mk:75: out/helper-images/prebuilt-arm.tar] Error 1
rm out/helper-images/prebuilt-arm.tar
Environment description
Problem occured during development of gitlab runner on a Linux x86_64:
Possible fixes
Fix the make file dependency.