Closed QuinnyPig closed 7 months ago
Hey, I can update the github workflows to create arm compatible images.
Is there a way to make things more clear? Is there any good way of doing? It's interesting
Big fan of your work!
I'm unsure as to the current state of the art way to do multi-arch builds, particularly with the interplay between Docker, buildx, and GitHub Actions; I did have to remove the explicit --arch=x64
in the Dockerfile; once I did that, it worked correctly to build the image on a Pi.
sudo docker buildx build --platform linux/amd64,linux/arm64 -t quinnypig/touitomamout:1.6.3 --push .
on a spare Pi 4 took a while, but did what you'd think it would once I whacked that flag out of the way.
Maybe it's easier than I thought; https://docs.docker.com/build/ci/github-actions/multi-platform/ has an example of precisely this with the GitHub Action you're already using.
Hey, you can get an arm version here: https://hub.docker.com/r/louisgrasset/touitomamout/tags with the dev
tag.
I think you'll encounter an error related to the usage of sharp
.
In fact, a command is used during the docker image build to specify the right arch to be used by sharp. As of today, this is hard-coded, so I have to find a fix.
Let me know if this is working or not!
You're right; sharp
throws an error:
What's strange is the built-on-arm image I have without the arch flag worked correctly. Hmm...
By installing the NPM deps, i wouldn't be surprised it's installing the right one automatically
This is what worked for me; I'm unsure whether the flag I removed is going to cause issues for other folks though, as I don't fully grasp why it was needed in the first place.
Separately, I shot you a DM on Twitter.
It sounds to be still working on amd64, let me know on arm side 👍🏻
Confirmed; working here without any tweaks.
I find this to be a useful thing to stuff on a Raspberry Pi (or in my case, a k8s cluster on a Raspberry Pi). I was able to manually build an Arm Docker image (and it works correctly), but the process to build images automatically in this repo is... arcane. Is there any appetite for figuring out how to make it build for both?