homey
homey copied to clipboard
Multiarch support
Hi!
Great project. Can multi arch support be added?
:+1: I'd be happy to add multiarch support but have no experience doing so. Is it purely a Docker image endeavor or do the supplied build instructions not work on ARM/etc machines? Thanks for your interest
Hello! I am interested in this project and multi-arch support as well. The project is a very interesting idea, and I can see more and more people using it, as more features get added over time!
Creating multi-arch images is very easy, especially when the underlying technology is already multi-arch (in your case, Nginx and Node.JS both have multi-arch support). What one usually does is just add the respective architectures in the build command. For Linux, it is common to build for amd64, armv7 and arm64v8 (the last two add ARM and ARM64 support, which includes the Raspberry Pi, which is what many people run such services on!).
If you are using docker buildx, it is more than easy. You just add the needed architectures as parameters of the --platform argument. To make sure it will properly run, I built my own images of homey and homey-api, and spun up containers on my arm64v8 Raspberry Pi 3. Homey worked as intended. The command structure you can follow to build multi-arch is:
docker buildx build --push --platform linux/arm/v7,linux/arm64/v8,linux/amd64 --tag vlfldr/homey-multiarch:latest . (I did not use --push in my trial, as I did not want to push to DockerHub. You may need to configure buildx appropriately to automatically push the image. Also, you need to run this while in your respective image's directory (hence the . at the end).)
You would also need to run the same command for your homey-api image. Note that, from what I have seen, it is common practice to create separate tags for each architecture, instead of a single, multi-arch image (though I might be wrong). Finally, remember that you would need to modify your docker-compose.yml in such a way that it would be able to download the correct image every time (that is if you do different tags per architecture).
Let us know whenever you get around to building the official multi-arch images!
Overall I agree with what @homelab-addict has said.
it is common practice to create separate tags for each architecture, instead of a single, multi-arch image
that it would be able to download the correct image every time (that is if you do different tags per architecture)
That just creates new problems and confusion. By publishing images with multiple architectures, the correct one is automatically pulled, and there's less issues stemming from GH actions.