docker-postgis icon indicating copy to clipboard operation
docker-postgis copied to clipboard

Add arm64 support using buildx

Open odidev opened this issue 2 years ago • 13 comments

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 [email protected]

odidev avatar Sep 22 '21 07:09 odidev

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

odidev avatar Sep 24 '21 05:09 odidev

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

  • https://hub.docker.com/_/postgres?tab=tags&page=1&ordering=last_updated&name=bullseye
  • see my PR https://github.com/postgis/docker-postgis/pull/257
  • sorry, this was unexpected.

ImreSamu avatar Sep 24 '21 06:09 ImreSamu

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?

phillipross avatar Sep 24 '21 16:09 phillipross

Hi there, is there any update on this PR?

RyanSiu1995 avatar Oct 31 '21 07:10 RyanSiu1995

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

Tob1as avatar Oct 31 '21 17:10 Tob1as

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.

phillipross avatar Oct 31 '21 20:10 phillipross

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

Its-Alex avatar Feb 11 '22 14:02 Its-Alex

Any update on this?

everdrone avatar Apr 29 '22 12:04 everdrone

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.

dmorehouse avatar Apr 12 '23 23:04 dmorehouse

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.

TimothyLoyer avatar Jun 08 '23 16:06 TimothyLoyer

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:

  • No official images are available via DockerHub
  • We cannot easily pinpoint a source tag that would allow us to check out a corresponding version and build it ourselves.

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.

jamesdh avatar Jun 12 '23 15:06 jamesdh

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

nitrag avatar Jan 23 '24 22:01 nitrag

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

@nitrag :

Work in progress ...

  • see: https://github.com/postgis/docker-postgis/issues/216#issuecomment-1763399631
    • test images: https://hub.docker.com/r/imresamu/postgis
    • test repo: https://github.com/ImreSamu/docker-postgis

status: testing ....

ImreSamu avatar Jan 23 '24 23:01 ImreSamu