ARM platforms not supported in the Dockerfiles on GHCR
The docs state that ARM is a supposed platform for the Docker way of installing libdragon, but it seems not to be the case. Using the libdragon CLI on my ARM based Mac I get the following:
➜ subi git:(main) ✗ libdragon init
Initializing a libdragon project at /Users/jc/code/subi
Downloading docker image: ghcr.io/dragonminded/libdragon:latest
latest: Pulling from dragonminded/libdragon
no matching manifest for linux/arm64/v8 in the manifest list entries
Command docker pull ghcr.io/dragonminded/libdragon:latest exited with code 1.
I was able to pull the image manually by specifying --platform to Docker pull, which means it'll run in emulated mode:
➜ subi git:(main) ✗ docker pull --platform x86_64 ghcr.io/dragonminded/libdragon:trunk
trunk: Pulling from dragonminded/libdragon
bccd10f490ab: Pull complete
c3a178414c27: Pull complete
90dbcfe357cb: Pull complete
Digest: sha256:b0263d3ed69068f5eaf0070a0cf2e2b379d3b37e36fe37737cf840eb03f16473
Status: Downloaded newer image for ghcr.io/dragonminded/libdragon:trunk
ghcr.io/dragonminded/libdragon:trunk
Happy to attempt to fix it myself and submit a PR, but not sure what would be preferred:
- Patching the CLI tool to set the platform, thus "hiding" the bug but potentially avoiding some x86/ARM related cross-compiling intricacies?
- Trying to build the Dockerfile on an ARM-supporting base (I suppose
ubuntu:22.04does, so no need to change?) and somehow modify the CI/CD scripts to publish for the ARM platform as well? Maybe the actual is that there's no ARM-based runners for thelibdragonCI/CD process?
Please advise. And thanks for volunteering your time to this project :)
It is supported normally but it requires me to manually remember to push the ARM image anytime there is a Dockerfile change, because GitHub CI doesn’t support arm64 last I checked.
The dockerfile was just updated yesterday and I haven’t pushed the updated image yet.
if you want to check if GitHub Action supports arm now and open a PR, that’d be great. I have a local script that I use to push the updated image, which also merges the two manifests. I can send it for reference
OK, I looked at it a bit more, basically trying bullet 2. The issue is that gcc-multilib is not supported on arm64 at all, so maybe a good-for-now solution would be to use Rosetta, i.e. force the CLI to fetch the linux/amd64 platform on Macs for now?
You don’t need gcc-multilib for the ARM build. Just comment it and it will build