buggregator / server

Buggregator is a lightweight, standalone server that offers a range of debugging features for PHP applications.
https://buggregator.dev/
Other
648 stars 23 forks source link

Docker image incompatible with arm64 #106

Closed maantje closed 9 months ago

maantje commented 9 months ago

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

Steps to reproduce

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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 commented 9 months ago

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.

butschster commented 9 months ago

@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.