Cross-compile Containers for ARM
At the time of this writing, X86-64 is the widest spread architecture for Workstations. This may cause us some headache : we can not run the same applications we use on our PCs, into the Raspberry Pi Cluster. We are left with couple options to work around this issue, either build our images on our Pi itself, or, cross-compilation locally. There are quite a few advantages from this setup, speed up the whole process of building, optimize your workflow, keep your babies clean. First thing first, you should have docker already installed on your machine. If you don’t, for debian-based distributions here it is :
Docker Buildx is included in Docker 19.03+. It allows us pick up a target architecture for which to build container images for, with a simple flag. Now we need to enable ARM support, install quemu : Configure and test :docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -t arm64v8/ubuntu uname -m
kubectl create secret docker-registry regcred --docker-server=registry.gitlab.com --docker-username=pervitiner00 --docker-password=changeme123
docker buildx build --platform linux/arm64 -t registry.gitlab.com/username/repository .