Support multiple architecture build for CNG images
Synopsis
Currently there is no cloud native GitLab Docker image available for arm64/aarch64, and we have to resort to using Omnibus on Graviton/Neoverse2/Pi4/ARM64 platform. This makes high availability difficult with pure ARM-based Kubernetes platform.
Proposal
Remove all references to amd64 and replace them with cross-platform alternatives (such as using a architecture-marking variable) for all images in https://gitlab.com/gitlab-org/build/CNG
Here's the list of initially-offending Dockerfile:
- https://gitlab.com/gitlab-org/build/CNG/-/blob/master/gitlab-go/Dockerfile.build.ubi8
- https://gitlab.com/gitlab-org/build/CNG/-/blob/master/gitlab-go/Dockerfile
- https://gitlab.com/gitlab-org/build/CNG/-/blob/master/kubectl/Dockerfile.build.ubi8
- https://gitlab.com/gitlab-org/build/CNG/-/blob/master/kubectl/Dockerfile
- https://gitlab.com/gitlab-org/build/CNG/-/blob/master/gitlab-gomplate/Dockerfile.build.ubi8
- https://gitlab.com/gitlab-org/build/CNG/-/blob/master/gitlab-gomplate/Dockerfile
Then we replace all Docker build with buildx and enable ARM64 build as well.
Extra Info
Oracle Cloud offers free ARM server with 4 cores, 24GB RAM and 200GB storage in total, and Oracle Kubernetes Engine is also free and can spawn A1 instances (which includes the free ARM servers in quota). We can use it as a test platform or even worker to run accelerated cross platform builds. Far as I tried, The ARM server's processing power of Oracle is as fast as Intel x86 server equivalent (sometimes even faster), so it is suitable to build on its own without cross compilers.