heroiclabs / nakama

Distributed server for social and realtime games and apps.
https://heroiclabs.com
Apache License 2.0
8.57k stars 1.06k forks source link

ARM64 missing from docker registry #1160

Open Darkbladecr opened 5 months ago

Darkbladecr commented 5 months ago

As per issue #1138 there is actually no docker image for arm64/v8

! nakama The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Now developers can build a local image and use it for development, but as @zyro mentioned:

Note it is usually not recommended to build from source or build your own docker images, use existing binaries and images where possible.

Happy to put together a PR for the docker buildx commands but I don't actually see the docker push in the source code?

linear[bot] commented 5 months ago

NK-522 ARM64 missing from docker registry

novabyte commented 5 months ago

@Darkbladecr It's been on our backlog to introduce official ARM64 images with Docker buildx multi-arch container images. If you've got time it would be great to have the contribution. We store our Dockerfiles in this folder in the codebase:

https://github.com/heroiclabs/nakama/tree/master/build

Darkbladecr commented 5 months ago

The binaries work fine when running the build scripts locally and the public releases. The only thing missing is to push the builds to docker. That’s why I was saying I don’t see any code in the repo that does this? It may be a CI pipeline that is not included in the repo?

I have personally used docker buildx which is really easy to build multiple arch builds

otherwise since you have the pipeline already prepared with the standard docker build command we can just amend the manifest file to link to the multiple builds with one docker URI: https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/

Darkbladecr commented 5 months ago

Created a PR that updates the Dockerfile and created a script for multiarch builds for stable versions and prebuild:

1161

Tested on my darwin/arm64 system, but will work on linux/arm64 as well. If the CI environment is based on linux/amd64 then the CC and CCX environmental variables will need to be updated