3 ms·
> you can build arm Docker images in QEMU super easy on GHA if you need hosted agents Yeah, you nailed it: it's fairly trivial to create cross architecture ima
by heywoodlh 4y ago
> you can build arm Docker images in QEMU super easy on GHA if you need hosted agents
Yeah, you nailed it: it's fairly trivial to create cross architecture images -- my preferred tool is Docker's buildx plugin[1].
I have an M1 Mac, Raspberry Pi 4 running 64 bit Ubuntu Server and multiple x86_64 bit machines. I try to exclusively use Docker images that are cross-architecture. When they are not cross-architecture I usually just build the project's Dockerfile using the Docker Buildx Github Action[2]. The majority of the time most projects' stock Dockerfile works on all architectures. The few times they don't work are usually when a Dockerfile grabs an x86_64 binary and downloads it. I feel like that is bad practice so I usually just write my own Dockerfile when I encounter that.
A recent image I did this with was Gitleaks[3] (link goes to my Github Action).
I will say I have found that while most projects usually compile well on all platforms, if I ever do run into issues it is usually on 32 bit ARM.
[1] https://docs.docker.com/buildx/working-with-buildx/ https://docs.docker.com/buildx/working-with-buildx/
[2]
https://github.com/docker/setup-buildx-action https://github.com/docker/setup-buildx-action
[3]
https://github.com/heywoodlh/actions/blob/master/.github/workflows/gitleaks-buildx.yml https://github.com/heywoodlh/actions/blob/master/.github/wor...