feat: Allow multi-architecture images
Reasoning
Since the introduction of Docker buildx, I've been following some issues that allowed Gitlab CICD to be run by other architectures than AMD64. My goal is to be able to run pipelines from my Raspberry Pi cluster that is a registered runner in my group. Currently, all AutoDevOps templates have some underlying issue that fails in non-x86 hosts. This issue describes one of them.
Resolution
Luckily this Terraform image is pretty simple and the multi-architecture implementation is very straightforward. First, we have the Dockerfile that explicitly downloads an AMD64 binary
Then we need to tell Docker Engine which architecture we're aiming to build. This is done from the docker build command, in which in this case is done in the .gitlab-ci.yml.
One caveat is that the docker host needs to be previously configured with BuildKit enabled.