Skip to content

Commit 78b87c6

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 (#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 #216 Fixes #393 Closes #387
1 parent c902fca commit 78b87c6

File tree

13 files changed

+67
-13
lines changed

13 files changed

+67
-13
lines changed

.github/workflows/main.yml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,64 @@ jobs:
128128
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
129129

130130
- 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
132131
if: ${{ (github.repository == 'postgis/docker-postgis') && (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') && ( matrix.runner-platform == 'ubuntu-24.04' ) }}
133132
env:
134133
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
135134
DOCKERHUB_ACCESS_TOKEN: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
136135
run: make push
137136

137+
- name: Push arch-tagged image for multi-arch manifest
138+
if: ${{ (github.repository == 'postgis/docker-postgis') && (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
139+
run: |
140+
ARCH=${{ matrix.runner-platform == 'ubuntu-24.04' && 'amd64' || 'arm64' }}
141+
if [ "${{ env.VARIANT }}" = "default" ]; then
142+
docker image tag postgis/postgis:${{ env.VERSION }} postgis/postgis:${{ env.VERSION }}-${ARCH}
143+
docker image push postgis/postgis:${{ env.VERSION }}-${ARCH}
144+
elif [ -d "${{ env.VERSION }}/alpine" ]; then
145+
docker image tag postgis/postgis:${{ env.VERSION }}-alpine postgis/postgis:${{ env.VERSION }}-alpine-${ARCH}
146+
docker image push postgis/postgis:${{ env.VERSION }}-alpine-${ARCH}
147+
fi
148+
149+
# Combine arch-tagged images into multi-arch manifests
150+
create-manifests:
151+
needs: make-docker-images
152+
if: ${{ (github.repository == 'postgis/docker-postgis') && (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
153+
name: Create multi-arch manifests
154+
runs-on: ubuntu-24.04
155+
156+
steps:
157+
- name: Checkout source
158+
uses: actions/checkout@v4
159+
160+
- name: Login to dockerhub
161+
uses: docker/login-action@v3
162+
with:
163+
username: ${{ secrets.DOCKERHUB_USERNAME }}
164+
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
165+
166+
- name: Create and push multi-arch manifests
167+
run: |
168+
REPO=postgis/postgis
169+
LATEST_VERSION=17-3.5
170+
171+
# Discover versions from the directory structure (same source of truth as the Makefile)
172+
for dir in */Dockerfile; do
173+
ver=$(dirname "$dir")
174+
echo "==> Creating manifest for ${REPO}:${ver}"
175+
docker manifest create "${REPO}:${ver}" \
176+
"${REPO}:${ver}-amd64" "${REPO}:${ver}-arm64" || true
177+
docker manifest push "${REPO}:${ver}" || true
178+
179+
if [ -d "${ver}/alpine" ]; then
180+
echo "==> Creating manifest for ${REPO}:${ver}-alpine"
181+
docker manifest create "${REPO}:${ver}-alpine" \
182+
"${REPO}:${ver}-alpine-amd64" "${REPO}:${ver}-alpine-arm64" || true
183+
docker manifest push "${REPO}:${ver}-alpine" || true
184+
fi
185+
done
186+
187+
echo "==> Creating manifest for ${REPO}:latest"
188+
docker manifest create "${REPO}:latest" \
189+
"${REPO}:${LATEST_VERSION}-amd64" "${REPO}:${LATEST_VERSION}-arm64" || true
190+
docker manifest push "${REPO}:latest" || true
191+

13-3.5/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ 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 ' \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
8282
&& cd regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\

14-3.5/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ 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 ' \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
8282
&& cd regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\

15-3.5/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ 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 ' \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
8282
&& cd regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\

16-3.5/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ 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 ' \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
8282
&& cd regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\

16-master/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ 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 \
408408
&& cd regress \
409409
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \

17-3.5/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ 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 ' \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
8282
&& cd regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\

17-3.6/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ 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 ' \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
8282
&& cd regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\

17-master/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ 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 \
408408
&& cd regress \
409409
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \

18-3.6/alpine/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ 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 ' \
81+
&& su postgres -c 'pg_ctl -D /tempdb -c -l /tmp/logfile -o "-F --jit=off" start ' \
8282
&& cd regress \
8383
&& make -j${NPROC:-$(nproc)} check RUNTESTFLAGS="--extension --verbose" PGUSER=postgres \
8484
\

0 commit comments

Comments
 (0)