Add arm64 Docker images for gitlab/gitlab-runner
What does this MR do?
This MR adds ARM64 Alpine/Ubuntu Docker images and makes images multi-platform. I've pushed an example to my Docker Hub space: pombeirp/gitlab-runner .
A big shout out to @solidnerd for his work on !725 (closed)!
Once this MR is merged, a follow-up PR to add support for 32-bit ARM should be very straightforward. It would also be nice to have the gitlab-runner-helper image be published as a multi-platform image, rather than relying on tags.
Relevant documentation:
- https://github.com/docker/buildx
- https://www.docker.com/blog/getting-started-with-docker-for-arm-on-linux/
- https://docs.docker.com/buildx/working-with-buildx/
Why was this MR needed?
There is a desire to have the GitLab Runner Docker image run on ARM64 platforms. See #2076 (closed).
Testing
Manual QA can be found
Are there points in the code the reviewer needs to double check?
- This MR removes the
release
tag since that build agent doesn't have a recent Linux kernel required by this MR. - This MR leverages the new
docker buildx
command which is experimental (added in a separate MR). The previous way of building multi-platform images involved a community tool called manifest-tool. - When
docker buildx
builds multi-platform images, those images cannot be loaded into the local image registry, they must be pushed directly to a remote registry. Therefore we'll need to tag and push the images directly when building, requiring some changes in theci/release_docker_images
script. - In order to use
docker buildx
successfully, we need to create:- a docker context (which contains the location of the host and certificate information)
- a build node that uses the
docker-container
driver rather than the defaultdocker
driver. - a host containing a Linux kernel with version >= 4.8
-
binfmt_misc
correctly installed on the host and with handlers for AMR64 binaries (we do this in.gitlab/ci/release.gitlab-ci.yml
withdocker run --rm --privileged multiarch/qemu-user-static --reset -p yes
)
- When publishing, we use the newer
buildx
logic in thexbuild_and_publish
function. If building locally, we fallback to the existing logic (becausebuildx
doesn't support adding incompatible platforms to thedocker images
list)
Does this MR meet the acceptance criteria?
-
Documentation created/updated -
Added tests for this feature/bug - N/A -
In case of conflicts with master
- branch was rebased
What are the relevant issue numbers?
Closes #2076 (closed)
Edited by Steve Xuereb