Skip to content
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

arm64 arch CPU support in binary and docker #544

Closed
GeniusWiki opened this issue Oct 27, 2021 · 16 comments
Closed

arm64 arch CPU support in binary and docker #544

GeniusWiki opened this issue Oct 27, 2021 · 16 comments
Labels
enhancement New feature or request

Comments

@GeniusWiki
Copy link

Whatever AWS graviton2 or new apple M1, ARM CPU becomes more popular. It is great if the docker can provide ARM64 compatible version, same in binary (although I don't need that).

@GeniusWiki GeniusWiki added the enhancement New feature or request label Oct 27, 2021
@knadh
Copy link
Owner

knadh commented Apr 3, 2022

@mr-karan would you like to take a look at this?

@alf1e
Copy link

alf1e commented Dec 23, 2022

I'm currently working on porting this to ARM and in the testing phase as we speak

@mr-karan mr-karan removed their assignment Dec 23, 2022
@alf1e
Copy link

alf1e commented Dec 23, 2022

I am currently stumped on this error

 > [2/6] RUN apk --no-cache add ca-certificates tzdata:
#7 0.224 exec /bin/sh: exec format error

I am working on a fix though, just very slowly cause this should work

@alf1e
Copy link

alf1e commented Dec 23, 2022

Ah great. The packages ca-certificates, tzdata don't support ARM. @knadh Do you know any workaround you know for this?

@knadh
Copy link
Owner

knadh commented Dec 24, 2022

I'm not familiar with Alpine, unfortunately. @mr-karan?

@nemunaire
Copy link

nemunaire commented Dec 24, 2022

FYI, I run listmonk on arm64 hardware since a few months using a Docker container.

I made a multi-stage Dockerfile in order to embed all the build steps inside: nemunaire@a8c7c2a
I run the Dockerfile to build the image directly on the host (where there is no npm, make, go, ...). I didn't make a PR as I think this is not the way you want to do that.

I can't help as I didn't know goreleaser, but most probably, the error:

#7 0.224 exec /bin/sh: exec format error

is because the docker image architecture is not the same as the hardware architecture who run the build (eg. image is arm64 and hardware is amd64). Without qemu it's not possible to do any RUN if architectures are not the same.

(With my all-in-one Dockerfile, the common solution is to use docker buildx with github actions this way: https://github.com/ddvk/rmfakecloud/blob/master/.github/workflows/release.yml#L50)

@mr-karan
Copy link
Collaborator

mr-karan commented Dec 27, 2022

Yeah, buildx is also one way to solve this.

With goreleaser, however it's possible to also use docker manifest and create a multi-arch image: https://goreleaser.com/customization/docker_manifest/. Manifest is basically some meta information about the image (and in this context, OS and Arch is what we're interested in). This also uses buildx internally to build the image.

Ah great. The packages ca-certificates, tzdata don't support ARM

Regarding ca-certificates, can you try this fix? https://stackoverflow.com/a/70771488/709452 @alf1e
I couldn't find much information about tzdata not working on alpine with ARM. Can you share a detailed error message?

Sidenote: I also think it's okay to switch to Ubuntu base for AMD/ARM architectures. The base size of an Ubuntu image is small enough and we don't have to worry about compatibility of packages, but we can keep that as a separate PR.

Let me know if you get stuck somewhere, would be happy to debug and help!

@mxvsh
Copy link

mxvsh commented Mar 7, 2023

any updates?

@Maxxxel
Copy link

Maxxxel commented Mar 9, 2023

I really wanna run this on my Pi :S

@kamyarhu
Copy link

kamyarhu commented Mar 13, 2023

I experience the same issue with Oracle instances with ARM CPU. I would be great if ARM64 is supported.

@navanchauhan
Copy link
Contributor

Now that #1249 has been merged, is there a possibility of doing a point release? (2.4.1), so we can start using the binaries

@knadh
Copy link
Owner

knadh commented Apr 2, 2023

Hi @navanchauhan. Doing a release just for this will cause every existing installation to do display a perpetual update prompt.

Why don't you try compiling it yourself for the time being?

@navanchauhan
Copy link
Contributor

Hi @navanchauhan. Doing a release just for this will cause every existing installation to do display a perpetual update prompt.

Why don't you try compiling it yourself for the time being?

Makes sense.

My install script https://github.com/YunoHost-Apps/listmonk_ynh is currently compiling everything from scratch. The lower powered systems like Raspberry Pi 3/4 (2GB), run out of memory while running yarn install because of how much resources Node takes.

For now everything is working, I'll just update it to use the binary whenever they are released. In the meanwhile, I'll also try and make a PR for getting the docker images working

@Kovah
Copy link

Kovah commented Apr 28, 2023

Any news on this, or anything I could help with? It's currently the only thing stopping me from moving to an ARM server. 😬

@Thunderbottom
Copy link
Contributor

I've added multiarch support for listmonk in this PR: #1344

For the time being you can build it locally using goreleaser with the following command:

$ goreleaser release --clean --snapshot

--snapshot will ensure that it doesn't try to push to remote.

I've tested the images locally, but feel free to try it out and let me know if you have any issues.

@Kovah
Copy link

Kovah commented Sep 20, 2023

I guess this issue can be closed as successfully done. The latest binaries and Docker images support ARM.
Many thanks!!!!

@knadh knadh closed this as completed Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests