Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

Commit 4e10e63

Browse files
committed
feat: add multi-architecture support (amd64 + arm64)
Enable ARM64 (Apple Silicon, AWS Graviton) support for all PostGIS Docker images by publishing multi-arch manifests to Docker Hub. Changes: Templates & Dockerfiles: - Disable JIT during regression tests (`--jit=off`) to prevent spinlock crashes under QEMU emulation on ARM64 (postgis#393) - Use absolute path for regress directory CI Workflow: - Push arch-tagged images from both amd64 and arm64 runners (previously only amd64 pushed) - Add manifest creation job that combines arch-specific images into multi-arch manifests after all builds complete README: - Update supported architectures to include arm64 The existing build matrix already runs on both ubuntu-24.04 (amd64) and ubuntu-24.04-arm (arm64) runners. This change enables the arm64 builds to be published alongside amd64, with Docker manifest lists providing automatic platform selection for users. Fixes postgis#216 Fixes postgis#393 Closes postgis#387
1 parent c902fca commit 4e10e63

13 files changed

Lines changed: 121 additions & 27 deletions

File tree

.github/workflows/main.yml

Lines changed: 98 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,105 @@ jobs:
127127
username: ${{ secrets.DOCKERHUB_USERNAME }}
128128
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
129129

130-
- name: Push docker image to dockerhub
131-
# !!!! ONLY push the images when built on ubuntu-24.04 x86 runner for now, NOT for ubuntu-24.04-arm runners
132-
if: ${{ (github.repository == 'postgis/docker-postgis') && (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') && ( matrix.runner-platform == 'ubuntu-24.04' ) }}
130+
- name: Determine architecture suffix
131+
id: arch
132+
run: |
133+
if [ "${{ matrix.runner-platform }}" = "ubuntu-24.04" ]; then
134+
echo "suffix=amd64" >> "$GITHUB_OUTPUT"
135+
else
136+
echo "suffix=arm64" >> "$GITHUB_OUTPUT"
137+
fi
138+
139+
- name: Push arch-tagged docker image to dockerhub
140+
if: ${{ (github.repository == 'postgis/docker-postgis') && (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
133141
env:
134142
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
135143
DOCKERHUB_ACCESS_TOKEN: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
136-
run: make push
144+
ARCH: ${{ steps.arch.outputs.suffix }}
145+
REPO_NAME: postgis
146+
IMAGE_NAME: postgis
147+
run: |
148+
VERSION="${{ env.VERSION }}"
149+
if [ "${{ env.VARIANT }}" = "default" ]; then
150+
docker image tag ${REPO_NAME}/${IMAGE_NAME}:${VERSION} ${REPO_NAME}/${IMAGE_NAME}:${VERSION}-${ARCH}
151+
docker image push ${REPO_NAME}/${IMAGE_NAME}:${VERSION}-${ARCH}
152+
fi
153+
if [ "${{ env.VARIANT }}" = "alpine" ] && [ -d "${VERSION}/alpine" ]; then
154+
docker image tag ${REPO_NAME}/${IMAGE_NAME}:${VERSION}-alpine ${REPO_NAME}/${IMAGE_NAME}:${VERSION}-alpine-${ARCH}
155+
docker image push ${REPO_NAME}/${IMAGE_NAME}:${VERSION}-alpine-${ARCH}
156+
fi
157+
158+
# Create multi-arch manifests combining amd64 and arm64 images
159+
create-manifests:
160+
needs: make-docker-images
161+
if: ${{ (github.repository == 'postgis/docker-postgis') && (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
162+
strategy:
163+
fail-fast: false
164+
matrix:
165+
postgres: [13, 14, 15, 16, 17]
166+
postgis: ['3.5']
167+
variant: [default, alpine]
168+
include:
169+
- postgres: 16
170+
postgis: master
171+
variant: default
172+
- postgres: 17
173+
postgis: master
174+
variant: default
175+
- postgres: 17
176+
postgis: '3.6'
177+
variant: alpine
178+
- postgres: 18
179+
postgis: '3.6'
180+
variant: alpine
181+
- postgres: 18
182+
postgis: '3.6'
183+
variant: default
184+
185+
name: manifest ${{ matrix.postgres }}-${{ matrix.postgis }}-${{ matrix.variant }}
186+
runs-on: ubuntu-24.04
187+
continue-on-error: ${{ matrix.postgis == 'master' }}
188+
env:
189+
VERSION: ${{ matrix.postgres }}-${{ matrix.postgis }}
190+
VARIANT: ${{ matrix.variant }}
191+
REPO_NAME: postgis
192+
IMAGE_NAME: postgis
193+
194+
steps:
195+
- name: Login to dockerhub
196+
uses: docker/login-action@v3
197+
with:
198+
username: ${{ secrets.DOCKERHUB_USERNAME }}
199+
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
200+
201+
- name: Create and push multi-arch manifest
202+
run: |
203+
if [ "${{ env.VARIANT }}" = "default" ]; then
204+
TAG="${{ env.VERSION }}"
205+
else
206+
TAG="${{ env.VERSION }}-${{ env.VARIANT }}"
207+
fi
208+
209+
echo "Creating manifest for ${REPO_NAME}/${IMAGE_NAME}:${TAG}"
210+
docker manifest create ${REPO_NAME}/${IMAGE_NAME}:${TAG} \
211+
${REPO_NAME}/${IMAGE_NAME}:${TAG}-amd64 \
212+
${REPO_NAME}/${IMAGE_NAME}:${TAG}-arm64
213+
docker manifest push ${REPO_NAME}/${IMAGE_NAME}:${TAG}
214+
215+
- name: Create latest manifest
216+
if: ${{ env.VERSION == '17-3.5' && env.VARIANT == 'default' }}
217+
run: |
218+
docker manifest create ${REPO_NAME}/${IMAGE_NAME}:latest \
219+
${REPO_NAME}/${IMAGE_NAME}:17-3.5-amd64 \
220+
${REPO_NAME}/${IMAGE_NAME}:17-3.5-arm64
221+
docker manifest push ${REPO_NAME}/${IMAGE_NAME}:latest
222+
223+
- name: Inspect manifest
224+
run: |
225+
if [ "${{ env.VARIANT }}" = "default" ]; then
226+
TAG="${{ env.VERSION }}"
227+
else
228+
TAG="${{ env.VERSION }}-${{ env.VARIANT }}"
229+
fi
230+
docker manifest inspect ${REPO_NAME}/${IMAGE_NAME}:${TAG}
137231

13-3.5/alpine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ RUN set -eux \
7878
&& mkdir /tempdb \
7979
&& chown -R postgres:postgres /tempdb \
8080
&& su postgres -c 'pg_ctl -D /tempdb init' \
81-
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
82-
&& cd regress \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
82+
&& cd /usr/src/postgis/regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\
8585
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \

14-3.5/alpine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ RUN set -eux \
7878
&& mkdir /tempdb \
7979
&& chown -R postgres:postgres /tempdb \
8080
&& su postgres -c 'pg_ctl -D /tempdb init' \
81-
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
82-
&& cd regress \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
82+
&& cd /usr/src/postgis/regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\
8585
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \

15-3.5/alpine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ RUN set -eux \
7878
&& mkdir /tempdb \
7979
&& chown -R postgres:postgres /tempdb \
8080
&& su postgres -c 'pg_ctl -D /tempdb init' \
81-
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
82-
&& cd regress \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
82+
&& cd /usr/src/postgis/regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\
8585
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \

16-3.5/alpine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ RUN set -eux \
7878
&& mkdir /tempdb \
7979
&& chown -R postgres:postgres /tempdb \
8080
&& su postgres -c 'pg_ctl -D /tempdb init' \
81-
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
82-
&& cd regress \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
82+
&& cd /usr/src/postgis/regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\
8585
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \

16-master/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,9 @@ RUN set -ex \
403403
&& mkdir /tempdb \
404404
&& chown -R postgres:postgres /tempdb \
405405
&& su postgres -c 'pg_ctl -D /tempdb init' \
406-
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
406+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
407407
&& ldconfig \
408-
&& cd regress \
408+
&& cd /usr/src/postgis/regress \
409409
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
410410
\
411411
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \

17-3.5/alpine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ RUN set -eux \
7878
&& mkdir /tempdb \
7979
&& chown -R postgres:postgres /tempdb \
8080
&& su postgres -c 'pg_ctl -D /tempdb init' \
81-
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
82-
&& cd regress \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
82+
&& cd /usr/src/postgis/regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\
8585
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \

17-3.6/alpine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ RUN set -eux \
7878
&& mkdir /tempdb \
7979
&& chown -R postgres:postgres /tempdb \
8080
&& su postgres -c 'pg_ctl -D /tempdb init' \
81-
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
82-
&& cd regress \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
82+
&& cd /usr/src/postgis/regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\
8585
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \

17-master/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,9 @@ RUN set -ex \
403403
&& mkdir /tempdb \
404404
&& chown -R postgres:postgres /tempdb \
405405
&& su postgres -c 'pg_ctl -D /tempdb init' \
406-
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
406+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
407407
&& ldconfig \
408-
&& cd regress \
408+
&& cd /usr/src/postgis/regress \
409409
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
410410
\
411411
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \

18-3.6/alpine/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ RUN set -eux \
7878
&& mkdir /tempdb \
7979
&& chown -R postgres:postgres /tempdb \
8080
&& su postgres -c 'pg_ctl -D /tempdb init' \
81-
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o '-F' start ' \
82-
&& cd regress \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
82+
&& cd /usr/src/postgis/regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\
8585
&& su postgres -c 'psql -c "CREATE EXTENSION IF NOT EXISTS postgis;"' \

0 commit comments

Comments
 (0)