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

Docker image incompatible with arm64 #106

Closed
maantje opened this issue Dec 2, 2023 · 5 comments
Closed

Docker image incompatible with arm64 #106

maantje opened this issue Dec 2, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request for contributors

Comments

@maantje
Copy link

maantje commented Dec 2, 2023

The latest Docker image of the Buggregator server is incompatible with arm64 machines.

Steps to reproduce

  • Get an arm64 machine (I am testing this on a cax11 server at Hetzner).
  • Install Docker.
  • docker pull ghcr.io/buggregator/server:latest
  • docker run ghcr.io/buggregator/server:latest
exec /usr/local/bin/docker-php-entrypoint: exec format error

Additional information

Docker inspect shows the correct arm64 architecture for the image. I did some digging and found the issue is not with the Buggregator server directly, but with the images from the repositories the server depends on.

ghcr.io/buggregator/frontend:latest gives me "Architecture": "amd64".
ghcr.io/buggregator/docker:latest also gives me "Architecture": "amd64".

Workaround

For now, I cloned the Buggregator server, docker, and frontend repositories. Then, I built my own arm64 images for frontend and docker, pushed them to ghcr.io, and edited the Dockerfile of the Buggregator server to use my images.

I built an arm64 image of the server and pushed that to ghcr.io as well.

I made the final image of the server public in case someone else needs it for now.

docker pull ghcr.io/maantje/buggregator:latest

@butschster butschster self-assigned this Dec 2, 2023
@butschster butschster added enhancement New feature or request for contributors labels Dec 2, 2023
@butschster
Copy link
Member

Hi @maantje,

It would be greatly beneficial to the community if you could share your changes. I encourage you to create a Pull Request with the modifications you made.

Your contribution would be a valuable addition to the project. Looking forward to seeing your PR!

Thx!

@maantje
Copy link
Author

maantje commented Dec 2, 2023

Hi @butschster,

Thanks for the quick reply! I haven't made any actual code changes; the diff is included below.

The issue lies in the workflows of the docker and frontend repositories:

docker repository workflow: Link
frontend repository workflow: Link

These workflows aren't configured for multi-platform images, resulting in only an amd64 variant due to the GitHub Actions runner's architecture.

To resolve this, the workflows should be updated for multi-platform support, as explained here: Docker Multi-platform Builds

If you're okay with it, I can create a PR for both repositories.

diff --git a/docker/Dockerfile b/docker/Dockerfile
index 3017df6..a4a941b 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -7,7 +7,7 @@ FROM centrifugo/centrifugo:$CENTRIFUGO_IMAGE as centrifugo
 # Build rr binary
 FROM ghcr.io/roadrunner-server/roadrunner:$ROAD_RUNNER_IMAGE as rr
 # Build JS files
-FROM ghcr.io/buggregator/frontend:$FRONTEND_IMAGE_TAG as frontend
+FROM ghcr.io/maantje/frontend:$FRONTEND_IMAGE_TAG as frontend
 # Clone the project
 FROM alpine/git as git
 
@@ -16,7 +16,7 @@ ARG BRANCH=master
 RUN git clone -b $BRANCH $REPOSITORY /app
 
 # Configure PHP project
-FROM ghcr.io/buggregator/docker:latest as backend
+FROM ghcr.io/maantje/docker:latest as backend
 
 COPY --from=git /app /app
 COPY --from=frontend /app /app/frontend

@butschster
Copy link
Member

Hi @maantje! I added both amd64 and arm64 platforms for the frontend and docker repositories. It would be great if you tried Buggregator v 1.3.0 to check if everything is ok.

@maantje
Copy link
Author

maantje commented Dec 4, 2023

Hi @butschster,

Thank you for the new release! I just gave it a try, and it seems all good! I also noticed Sentry reports are now coming through as well; I couldn't get them to work before.

@maantje maantje closed this as completed Dec 4, 2023
@butschster
Copy link
Member

butschster commented Dec 5, 2023

@maantje
Thx for the feedback!

I also noticed Sentry reports are now coming through as well; I couldn't get them to work before.

Yeah, at last, I found some time to cover the handlers with feature tests, and it helped to fix the issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request for contributors
Projects
Archived in project
Development

No branches or pull requests

2 participants