-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-arch build #2
Conversation
This will automatically create PRs to update the versions of the GitHub Actions e.g. `docker/login-action@v2` will update to `docker/login-action@v3` through a PR when available.
Standard way to build on multiple architectures with GitHub Actions. I added amd64 (the default) and arm architectures. Feel free to change them if they don't work.
Hi, Thank you for the pr. Can you change mangal's architecture in Dockerfile too? I would like to help but I don't have any arm device. Lines 36 to 39 in 5713b20
|
mangal is only compiled for amd64, and the dev has a complete lack of instructions on building it from source (this is the first time I ever see a popular repo that lacks any build instructions). I posted an issue asking about it (metafates/mangal#107), once the dev publishes build instructions, you will need to build mangal in your Dockerfile, then you can use it on other architectures. In principle, I could run mangal on ARM using QEMU, but the performance would be very bad compared to a binary built for ARM. |
If you check the release page, it has several architectures. |
I didn't see all the architectures on the release page, my bad, I was critical without having seen them :P |
@oae I would add a few RUN if [ uname -m = "aarch64" ] \
then \
curl -L https://github.com/metafates/mangal/releases/download/v3.12.0/mangal_3.14.0_Linux_arm64.tar.gz -o mangal.tar.gz
elif [ uname -m == "x86_64" ] \
then \
curl -L https://github.com/metafates/mangal/releases/download/v3.12.0/mangal_3.12.0_Linux_x86_64.tar.gz -o mangal.tar.gz
elif [ uname -m == "armv6l" ] \
then \
curl -L https://github.com/metafates/mangal/releases/download/v3.12.0/mangal_3.14.0_Linux_armv6.tar.gz -o mangal.tar.gz
elif [ uname -m == "i386" ] \
then \
curl -L https://github.com/metafates/mangal/releases/download/v3.12.0/mangal_3.14.0_Linux_i386.tar.gz -o mangal.tar.gz
RUN tar xf mangal.tar.gz
RUN mv mangal /usr/bin/mangal
RUN chmod +x /usr/bin/mangal I have not tested that the 4 If you want to support more Linux architectures, you will need to build the binary in your Dockerfile. The dev added instructions, and I can help there. |
Build mangal in a new `FROM golang` layer to support more architectures, or use if statements based on `uname -m` to decide which file to download like I did.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Miswrote the version numbers
I added a few changes to support multiple architectures more easily. |
the base image I use from linuxserver does not have all the platforms you specified. It only has arm64 and x86_64 |
I also added a build job to pull requests so we can test if images are built successfully. |
I changed the architectures to only x86_64 (amd64) and arm64 |
I wonder if we can speed up the build. This takes too long and fails at the end because of timeouts. |
I am not knowledgeable in Typescript and Lua, I can't help much there :/ However, if you need a faster Action to see if the Docker images build without error, I can help a little. For example, you can adjust your GitHub Action temporarily like below - name: Build
uses: docker/build-push-action@v3
with:
context: .
file: docker/Dockerfile
push: false
# Possible architectures
#platforms: linux/amd64,linux/arm64,linux/riscv64,linux/ppc64le,linux/s390x,linux/386,linux/mips64le,linux/mips64,linux/arm/v7,linux/arm/v6
--- platforms: linux/amd64,linux/arm64
+++ platforms: linux/arm64 |
@oae I know it is late, but I just thought that if you run into timeouts again later, you can split the Action in 2 separate Action files: one for |
I enabled multi-arch builds, and daily PRs to update all GitHub Actions.