voyager icon indicating copy to clipboard operation
voyager copied to clipboard

Build Docker images for Arm v8

Open Crazybus opened this issue 2 years ago • 3 comments

I'm currently building this locally on Arm v8 and the build is working perfectly! Thought I'd open this up to see if you would be interested in hosting the images to save me having to rebuild for every release.

Crazybus avatar Jul 01 '23 16:07 Crazybus

Would be happy to get this in! Can you check why the build is failing though?

aeharding avatar Jul 01 '23 17:07 aeharding

Looks like an intermittent failure with the Yarn package registry, a simple rebuild may get things working again:

232.3 error An unexpected error occurred: "https://registry.yarnpkg.com/ionicons/-/ionicons-7.1.2.tgz: ESOCKETTIMEDOUT".

joshdick avatar Jul 01 '23 20:07 joshdick

Looks like an intermittent failure with the Yarn package registry, a simple rebuild may get things working again:

Looks to be a known and not fixed issue in Yarn v1: https://github.com/yarnpkg/yarn/issues/8242. I added in the workaround of increasing the network timeout (even though the issue isn't a network timeout) to see if that helps.

Crazybus avatar Jul 02 '23 02:07 Crazybus

@aeharding Looks like this should be good to merge now that the build is passing?

joshdick avatar Jul 03 '23 07:07 joshdick

tbh I am worried about this build being flakey with the network issues. 😅

I'll merge, but I will revert if it's breaking the build

Thanks for the PR :)

aeharding avatar Jul 03 '23 14:07 aeharding

I'll merge, but I will revert if it's breaking the build

Yup totally fair, I don't mind building my own at all if it becomes a pain to maintain. If you end up having to revert we could instead look at how hard it is to migrate to the v2 format where this is apparently fixed.

Crazybus avatar Jul 04 '23 03:07 Crazybus

Sounds good! I also looked at changing to pnpm, which I'm totally open to switching to, but I had a problem with getting deps to work. If you want to take a shot I'm all for it!

aeharding avatar Jul 04 '23 04:07 aeharding

🤔 Hmm, seems like I'm still not able to pull a prebuilt ARM v8 image after both this PR was merged and v0.12 was released:

❯ sudo docker pull ghcr.io/aeharding/wefwef:latest

latest: Pulling from aeharding/wefwef
no matching manifest for linux/arm64/v8 in the manifest list entries

joshdick avatar Jul 04 '23 05:07 joshdick

Hmm, seems like I'm still not able to pull a prebuilt ARM v8 image after both this PR was merged and v0.12 was released:

Just checked and it is working for me 🤔

I can also see the new image being listed here https://github.com/aeharding/wefwef/pkgs/container/wefwef.

Crazybus avatar Jul 04 '23 06:07 Crazybus

Ah, looks like the difference is that my machine is looking for linux/arm64/v8 but this PR added the platform linux/arm/v8 (arm vs. arm64.)

The image does still run if I manually pull it this way and start a container explicitly referencing the image ID:

sudo docker pull ghcr.io/aeharding/wefwef --platform linux/arm/v8

But Docker warns when starting the container:

WARNING: The requested image's platform (linux/arm/v8) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Should I open a 2nd PR that also adds linux/arm64/v8 to the platforms list?

joshdick avatar Jul 04 '23 07:07 joshdick

Typically, an arm64 image would be referenced as linux/arm64 and not linux/arm/v8. See https://docs.docker.com/build/building/multi-platform/. I am not an expert on GitHub Actions but I wouldn't think it would be any different.

Image from the registry:

$ docker image inspect ghcr.io/aeharding/wefwef | jq -r '.[] | "\(.Architecture) \(.Variant) \(.Os)"'
arm v8 linux

Image I built on my m1 macbook:

$ docker image inspect docker.io/mbentley/wefwef | jq -r '.[] | "\(.Architecture) \(.Variant) \(.Os)"'
arm64 v8 linux

mbentley avatar Jul 04 '23 14:07 mbentley

PR welcome to address! I'd lean to renaming it instead of adding another if it solves the problem

aeharding avatar Jul 04 '23 18:07 aeharding