eduardolat / pgbackweb

🐘 Effortless PostgreSQL backups with a user-friendly web interface! 🌐💾
MIT License
935 stars 45 forks source link

Support for arm64 images #18

Open arminus opened 3 months ago

arminus commented 3 months ago

First of all, great idea and looking forward to the planned features!

Since my always-on box at home is a Pi4, I've tried to test this there by extending your Dockerfile for arm64, see here. Cross built the image (on a faster amd64) like so:

docker buildx create --name mybuilder --use
docker buildx inspect --bootstrap
docker buildx build --platform linux/arm64 -t pgbackweb:latest --output type=docker,dest=pgbackweb.tar .

Then, to bypass a docker registry for now, copied the image to the Pi4 and loaded it with

docker load -i pgbackweb.tar

Works like a charm.

In case you're interested, I'd create a PR, maybe I also have time to checkout how to set this up in a github build pipeline for arm64 but I haven't done this before so no promises ;-)

eduardolat commented 3 months ago

Great! It can be very useful, just make sure your PR doesn't add too much complexity to the project, as it's important to keep it as simple as possible.

Thanks for considering contributing to the project.

arminus commented 3 months ago

No complexity, it's just platform specific wgets in your Dockerfile, see https://github.com/eduardolat/pgbackweb/pull/21

I see no github pipeline for how you build and publish your Docker image, so I can't automate that I'm afraid.

ykrasik commented 2 months ago

+1 on this, please

ThisIsBenny commented 1 month ago

+1

eduardolat commented 1 month ago

Thanks @arminus for your great help.

Since you opened your pr, there have been many changes to the Dockerfiles, the base image has been changed, dependencies have been added, and many other things.

However, I have taken the changes proposed in your pr #21 and adapted them to the new Dockerfiles.

I have also included a script that checks that the dependencies are working correctly and I have added it to the github actions tests workflow.

All that is left is to add a github action to automatically publish the image in each release.

Everything is working perfectly and this will be published in the next release, thanks for your help and thanks to everyone for the interest in the project 🍻

image

eduardolat commented 1 month ago

This has been published in the v0.3.0 release https://github.com/eduardolat/pgbackweb/releases/tag/0.3.0

ThisIsBenny commented 1 month ago

I got the error: exec user process caused: exec format error Which usually happens when it is not an ARM64 image. Is the image working for some one?

eduardolat commented 1 month ago

hey @ThisIsBenny, can you try to pull the latest version with this command?

docker pull --platform=linux/arm64 eduardolat/pgbackweb:0.3.0

And then explicitly set in your compose file the version of your image to

services:
  pgbackweb:
    image: eduardolat/pgbackweb:latest:0.3.0

## rest of your config
ThisIsBenny commented 1 month ago

I have used it with my Raspberry PI Kubernetes Cluster, why i'm not able to specify the platform manually. But I have used the 0.3.0 Tag and also tried with the SHA hash of the Arm image like 0.3.0@sha....

eduardolat commented 1 month ago

Can you please try (just for test purposes) with the docker compose in the README.md?

arminus commented 1 month ago
docker pull --platform=linux/arm64 eduardolat/pgbackweb:0.3.0

then compose

image: eduardolat/pgbackweb:0.3.0

(note: 2 tags are illegal syntax)

does not work, still getting exec format error.

I assume the Manifest for the images is wrong or missing:

docker manifest inspect eduardolat/pgbackweb:0.3.0
no such manifest: docker.io/eduardolat/pgbackweb:0.3.0

Normally (with all other images I run on my Pi4), I don't have to explicitly set the platform when pulling, docker figures this out on its own if the images are configured properly (but I haven't built multiplatform images myself yet, so I can only guess here)