Make Dockerfile compatible with ARM architecture
KEINOS opened this issue ยท 6 comments
[Enhancement]
Happy New Year!
Currently (as of 3641b3f), the Dockerfile creates an image for AMD64 (Intel-compatible) binary with GOARCH=amd64
option.
Lines 21 to 32 in 3641b3f
It would be nice to provide Dockerfile for ARM architecture as well. Such as RaspberryPi 3 (ARMv7) and Raspberry Pi Zero (ARMv6).
Seems that Golang supports ARM architecture and has some success stories on Raspberry Pies.
If I may, as soon as I success to make one, I will PR the Dockerfile. But please keep your expectations low. ;-)
Sounds good!
Finally, I think I came up with a solution to fix this issue.
With this fix, we can provide "ikawaha/kagome:latest
" Docker image tag which is compatible with x86_64 (Intel/AMD) and ARMs. Such as ARM v6 (RasPi Zero) and ARM v7 (RasPi 3+). (Maybe compatible with the upcoming ARM Mac as well)
But before any PR, I have a question.
Do you prefer to use GitHub Actions to automate the build and push the images to DockerHub?
or wish to release the images manually?
- Automatic
- PROS: Once the settings are set, only push your commit to "v2" branch and will automatically release the docker images.
- CONS: You need to set the TOKENs from Docker Hub to the GitHub repo's secret setting for the first time.
- Manual
- PROS: You can control the tags.
- CONS: You need to enable the experimental feature of Docker.
I suggest the first one, automate, using the GitHub actions.
The thing is that, to make a single Docker image tag,"ikawaha/kagome:latest
", which works on all those platforms above is a little complicated.
Because there's a long-lasting bug in Docker which can not detect the architecture, if "arm/v6" and "arm/v7" are mixed in one tag (manifest).
- "ARMv6 machine pulls v7 image from manifest list" moby/moby#37647
To make it work, we need a temporary workaround. (Change the variant value of "arm6" and "arm7" in "latest" tag's manifest)
I made a GitHub action to do all the things for this. But if you prefer to release the images manually, I will create a shell script to do so.
- Sample GitHub Actions workflow in my fork @ GitHub
- Sample Docker image:
keinos/kagome:latest
@ DockerHub
I prefer automated releases! โญ( ๏ฝฅใ ๏ฝฅ)ู ฬฬ
roger (๏ฟฃ^๏ฟฃ)ใ
I will PR what I came up with, as soon as I finish some refactoring (cleaning) the workflow.
We did it. 10 months to close the issue... finally ๐