postgis / docker-postgis

Docker image for PostGIS
https://hub.docker.com/r/postgis/postgis/
MIT License
1.37k stars 462 forks source link

Add arm64 support using buildx #256

Open odidev opened 2 years ago

odidev commented 2 years ago

The following file has been created and modified: Added support of buildx in Makefile to build and push the docker image for arm64 and amd64 platforms. Updated .github/workflows/main.yml to build, test and push the images for the latest versions to docker hub.

Signed-off-by: odidev odidev@puresoftware.com

odidev commented 2 years ago

@phillipross, I have made suggested changes. Please review and let me know your feedback.

ImreSamu commented 2 years ago

@odidev : question: As I see 6 images have been removed from the CI matrix; Is it possible to keep them only in the linux/amd64 version?

A few hours ago .. the upstream postgres image has been upgraded to bullseye .. so probably needs some extra check.

phillipross commented 2 years ago

I think there's going to be more work needed to get everything working well here with both platforms.

  1. We would not want to exclude versions/variants from the build simply for not having arm builds available within the distributions. I think the makefile and update scripts will need work to keep track of which versions of which distros provide the packages for which platform, and then build what's available.
  2. The build-test-push workflow(s) should remain decoupled so that the CI (and devs) can invoke each stage and observe failures at that stage, whether it's building the image, testing the image, or pushing to the image repo. I know this is a little difficult with buildx and multiplatform images, but I believe it's possible.

I see that @odidev is actively pushing changes to the PR, but as it stands now, the PR only builds the multiplatform images as part of the push target which is problematic since the push target is only invoked when PRs are merged to the main repo. This needs to change so that the build targets build the images, the test targets run the tests against the images that are built (this is a challenge, i know), and then the push target pushes the blessed images to the image repo.

I'm not sure if this PR is the best place to discuss all of this or not. Maybe we should use the existing issue #216 to discuss?

RyanSiu1995 commented 2 years ago

Hi there, is there any update on this PR?

Tob1as commented 2 years ago

Hi, would it also be possible to add additional arm32 (linux/arm/v7) support?

phillipross commented 2 years ago

Hi there, is there any update on this PR?

@RyanSiu1995 No update yet, we're still working on it

Hi, would it also be possible to add additional arm32 (linux/arm/v7) support?

@Tob1as I'm sure it will be possible, but with some work.

Its-Alex commented 2 years ago

Hi, any update on this MR pls? :pray:

everdrone commented 2 years ago

Any update on this?

dmorehouse commented 1 year ago

What remains to be done to add arm64 (linux/arm64/v8) as an architecture in the official postgis DockerHub images? I'm happy to help in any capacity. I see a huge performance loss running the AMD64 images on the new Apple M series Macs. The official Postgres images have added linux/arm64/v8 to all supported images. Given the popularity of this platform I think it makes sense to support it as an official architecture.

TimothyLoyer commented 1 year ago

I am currently resorting to copying the Dockerfile and scripts into our development environment so that my co-workers using Apple laptops with M1/2 chips are able to run Postgres + PostGIS by building it themselves. I just revisited that code because PostGIS 3.3.2 appears to have been removed from Apt and the build broke - it took me quite a few minutes to understand why I would ever have copied someones Dockerfile so closely.

I don't understand why there is no ARM support when it is fully supported by the base image/dependencies in the Dockerfile; these architectures have gained a ton of popularity in the past 5 years- especially in cloud computing where PostGIS is needed.

jamesdh commented 1 year ago

Compounding matters is that the docker-postgis team doesn't have any real form of release management. They have a single branch that they keep up to the latest version, and that's it. So for those of us on arm64:

We're stuck with having to use the latest version. We'd prefer to match our Google Cloud SQL environment, which supports only up to 3.1.8, not 3.3.3.

nitrag commented 7 months ago

Hello.....? I'm stumped. I'm not sure what else to say. Bump, please!

ImreSamu commented 7 months ago

Hello.....? I'm stumped. I'm not sure what else to say. Bump, please!

@nitrag :

Work in progress ...

status: testing ....