listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

arm64 arch CPU support in binary and docker

Open GeniusWiki opened this issue 4 years ago • 15 comments

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 avatar Oct 27 '21 04:10 GeniusWiki

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

knadh avatar Apr 03 '22 14:04 knadh

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

alf1e avatar Dec 23 '22 10:12 alf1e

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 avatar Dec 23 '22 21:12 alf1e

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

alf1e avatar Dec 23 '22 21:12 alf1e

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

knadh avatar Dec 24 '22 16:12 knadh

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: https://github.com/nemunaire/listmonk/commit/a8c7c2a5d92091883ab4fef5ac888812175d6431 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)

nemunaire avatar Dec 24 '22 17:12 nemunaire

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!

mr-karan avatar Dec 27 '22 04:12 mr-karan

any updates?

mxvsh avatar Mar 07 '23 14:03 mxvsh

I really wanna run this on my Pi :S

Maxxxel avatar Mar 09 '23 14:03 Maxxxel

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

kamyarhu avatar Mar 13 '23 14:03 kamyarhu

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

navanchauhan avatar Apr 02 '23 07:04 navanchauhan

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?

knadh avatar Apr 02 '23 14:04 knadh

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

navanchauhan avatar Apr 02 '23 17:04 navanchauhan

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

Kovah avatar Apr 28 '23 09:04 Kovah

I've added multiarch support for listmonk in this PR: https://github.com/knadh/listmonk/pull/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.

Thunderbottom avatar May 23 '23 10:05 Thunderbottom

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

Kovah avatar Sep 20 '23 19:09 Kovah