Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/scripts/check-base-image-platform.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#!/usr/bin/env bash
#
# Check that every base image used by a Dockerfile is published for the
# native platform of the local Docker daemon (e.g. linux/arm64).
#
# Why: if a base image has no manifest for the native platform, Docker does
# NOT fail. It silently pulls a "compatible" one instead (for example
# linux/arm/v7 on an arm64 host) and only prints an InvalidBaseImagePlatform
# warning. The build then fails much later with confusing errors.
#
# Usage: check-base-image-platform.sh <path/to/Dockerfile>

set -euo pipefail

dockerfile="${1:?Usage: $0 <path/to/Dockerfile>}"


# Print the external base images referenced by FROM lines.
# - ARG default values are substituted, e.g. FROM ${BASE_IMAGE}
# - references to earlier build stages (FROM builder) are skipped
list_base_images() {
local -A arg_defaults=()
local -A stage_names=()
local keyword value as_keyword stage_name name image

while read -r keyword value as_keyword stage_name _; do
case "${keyword^^}" in
ARG)
# ARG NAME=default
if [[ "$value" == *=* ]]; then
arg_defaults["${value%%=*}"]="${value#*=}"
fi
;;
FROM)
# FROM image [AS stage_name]
image="$value"
for name in "${!arg_defaults[@]}"; do
image="${image//\$\{$name\}/${arg_defaults[$name]}}"
done

if [[ -z "${stage_names[$image]:-}" ]]; then
echo "$image"
fi

if [[ "${as_keyword^^}" == "AS" ]]; then
stage_names["$stage_name"]=1
fi
;;
esac
done < "$dockerfile"
}


# Return success if the image's manifest list contains the given os/arch.
image_has_platform() {
local image="$1" os="$2" arch="$3"

docker buildx imagetools inspect --raw "$image" \
| jq --exit-status --arg os "$os" --arg arch "$arch" \
'.manifests[]? | select(.platform.os == $os and .platform.architecture == $arch)' \
> /dev/null
}


native_os=$(docker version --format '{{.Server.Os}}')
native_arch=$(docker version --format '{{.Server.Arch}}')
echo "Dockerfile: $dockerfile"
echo "Native platform: $native_os/$native_arch"

missing=0
for image in $(list_base_images | sort -u); do
if image_has_platform "$image" "$native_os" "$native_arch"; then
echo "OK: $image is available for $native_os/$native_arch"
else
echo "::error::Base image $image is not available for $native_os/$native_arch" \
"(Docker would silently fall back to another platform, e.g. linux/arm/v7)"
missing=1
fi
done

exit "$missing"
16 changes: 13 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
matrix:
runner-platform: ['ubuntu-24.04', 'ubuntu-24.04-arm']
postgres: [14, 15, 16, 17, 18, 19rc1]
postgres: [14, 15, 16, 17, 18, 19rc2]
postgis: ['3.7']
variant: [default, alpine]
include:
Expand All @@ -32,7 +32,7 @@ jobs:
postgis: master
variant: default
runner-platform: 'ubuntu-24.04'
- postgres: 19rc1
- postgres: 19rc2
postgis: master
variant: default
runner-platform: 'ubuntu-24.04'
Expand All @@ -48,7 +48,7 @@ jobs:
postgis: master
variant: default
runner-platform: 'ubuntu-24.04-arm'
- postgres: 19rc1
- postgres: 19rc2
postgis: master
variant: default
runner-platform: 'ubuntu-24.04-arm'
Expand Down Expand Up @@ -115,6 +115,16 @@ jobs:
- name: Checkout source
uses: actions/checkout@v7

- name: Check base image platform for ${{ env.VERSION }} ${{ env.VARIANT }}
# Docker silently falls back to a "compatible" platform (e.g. linux/arm/v7 on an arm64 host)
# when the base image has no manifest for the native platform. Fail early instead.
run: |
if [[ "$VARIANT" == "alpine" ]]; then
.github/scripts/check-base-image-platform.sh "$VERSION/alpine/Dockerfile"
else
.github/scripts/check-base-image-platform.sh "$VERSION/Dockerfile"
fi

- name: Build docker image for ${{ env.VERSION }} ${{ env.VARIANT }}
run: make test

Expand Down
4 changes: 2 additions & 2 deletions 14-3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
FROM docker.io/postgres:14-trixie

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.7.0+dfsg-1.pgdg13+1 spatial database extension with PostgreSQL 14 trixie" \
org.opencontainers.image.description="PostGIS 3.7.0+dfsg-1.pgdg13+2 spatial database extension with PostgreSQL 14 trixie" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR=3
ENV POSTGIS_VERSION=3.7.0+dfsg-1.pgdg13+1
ENV POSTGIS_VERSION=3.7.0+dfsg-1.pgdg13+2

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
Expand Down
4 changes: 2 additions & 2 deletions 15-3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
FROM docker.io/postgres:15-trixie

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.7.0+dfsg-1.pgdg13+1 spatial database extension with PostgreSQL 15 trixie" \
org.opencontainers.image.description="PostGIS 3.7.0+dfsg-1.pgdg13+2 spatial database extension with PostgreSQL 15 trixie" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR=3
ENV POSTGIS_VERSION=3.7.0+dfsg-1.pgdg13+1
ENV POSTGIS_VERSION=3.7.0+dfsg-1.pgdg13+2

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
Expand Down
4 changes: 2 additions & 2 deletions 16-3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
FROM docker.io/postgres:16-trixie

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.7.0+dfsg-1.pgdg13+1 spatial database extension with PostgreSQL 16 trixie" \
org.opencontainers.image.description="PostGIS 3.7.0+dfsg-1.pgdg13+2 spatial database extension with PostgreSQL 16 trixie" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR=3
ENV POSTGIS_VERSION=3.7.0+dfsg-1.pgdg13+1
ENV POSTGIS_VERSION=3.7.0+dfsg-1.pgdg13+2

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
Expand Down
22 changes: 11 additions & 11 deletions 16-master/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ RUN set -ex \
# CGAL and SFCGAL.
ARG CGAL_GIT_BRANCH
ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH}
ENV CGAL_GIT_HASH=ffd0b3a7d7dcc53ed260d513df01a9f7b7c2ae33
ENV SFCGAL_GIT_HASH=ac4942f2ef2ea201533586e4efe47b04afc64f77
ENV CGAL_GIT_HASH=2cc6fe7ba2744e7918341a8cb7e0820a06e1d66d
ENV SFCGAL_GIT_HASH=6d4465a79314aafcac973d64a9375532cab6ab4f
RUN set -ex \
&& mkdir -p /usr/src \
&& cd /usr/src \
Expand Down Expand Up @@ -149,7 +149,7 @@ RUN set -ex \
&& rm -fr /usr/src/cgal

# PROJ.
ENV PROJ_GIT_HASH=294069aa3e068036e30c6d0346949084db5d48d3
ENV PROJ_GIT_HASH=890f8a0599ee4600344c8b630df5e4bc4762c83f
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/OSGeo/PROJ.git \
Expand Down Expand Up @@ -182,7 +182,7 @@ RUN set -ex \
&& rm -fr /usr/src/PROJ

# GEOS.
ENV GEOS_GIT_HASH=8bace6161f6593643e45875d7972247699357720
ENV GEOS_GIT_HASH=06da4f3a7808288b3aef036aed02c866038985ad
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/libgeos/geos.git \
Expand All @@ -198,7 +198,7 @@ RUN set -ex \
&& rm -fr /usr/src/geos

# GDAL.
ENV GDAL_GIT_HASH=fa1fc3c77e75787c614e12a2ba5ac366db833e1f
ENV GDAL_GIT_HASH=a077f4a553b53bb2d1364259d3018201d11f882a
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/OSGeo/gdal.git \
Expand Down Expand Up @@ -345,11 +345,11 @@ COPY --from=builder /usr/local /usr/local

ARG CGAL_GIT_BRANCH
ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH}
ENV CGAL_GIT_HASH=ffd0b3a7d7dcc53ed260d513df01a9f7b7c2ae33
ENV SFCGAL_GIT_HASH=ac4942f2ef2ea201533586e4efe47b04afc64f77
ENV PROJ_GIT_HASH=294069aa3e068036e30c6d0346949084db5d48d3
ENV GEOS_GIT_HASH=8bace6161f6593643e45875d7972247699357720
ENV GDAL_GIT_HASH=fa1fc3c77e75787c614e12a2ba5ac366db833e1f
ENV CGAL_GIT_HASH=2cc6fe7ba2744e7918341a8cb7e0820a06e1d66d
ENV SFCGAL_GIT_HASH=6d4465a79314aafcac973d64a9375532cab6ab4f
ENV PROJ_GIT_HASH=890f8a0599ee4600344c8b630df5e4bc4762c83f
ENV GEOS_GIT_HASH=06da4f3a7808288b3aef036aed02c866038985ad
ENV GDAL_GIT_HASH=a077f4a553b53bb2d1364259d3018201d11f882a

# Minimal command-line smoke test (fail fast).
RUN set -ex \
Expand All @@ -368,7 +368,7 @@ RUN set -ex \
|| echo "ogr2ogr missing PostgreSQL driver" && exit 1

# Install PostGIS and companion development extensions.
ENV POSTGIS_GIT_HASH=625d3e52118717383edff7b3b94026e706ae4e98
ENV POSTGIS_GIT_HASH=c87677a620f814978f9eb3dced943c2b1241d149
ENV H3_PG_GIT_HASH=f960a574eab6aebd186dedff6204711c21742f12
ENV ADDRESS_STANDARDIZER_GIT_HASH=ba9a26a013f23908657bb26574ae436b11d4b811

Expand Down
4 changes: 2 additions & 2 deletions 17-3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
FROM docker.io/postgres:17-trixie

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.7.0+dfsg-1.pgdg13+1 spatial database extension with PostgreSQL 17 trixie" \
org.opencontainers.image.description="PostGIS 3.7.0+dfsg-1.pgdg13+2 spatial database extension with PostgreSQL 17 trixie" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR=3
ENV POSTGIS_VERSION=3.7.0+dfsg-1.pgdg13+1
ENV POSTGIS_VERSION=3.7.0+dfsg-1.pgdg13+2

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
Expand Down
22 changes: 11 additions & 11 deletions 17-master/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ RUN set -ex \
# CGAL and SFCGAL.
ARG CGAL_GIT_BRANCH
ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH}
ENV CGAL_GIT_HASH=ffd0b3a7d7dcc53ed260d513df01a9f7b7c2ae33
ENV SFCGAL_GIT_HASH=ac4942f2ef2ea201533586e4efe47b04afc64f77
ENV CGAL_GIT_HASH=2cc6fe7ba2744e7918341a8cb7e0820a06e1d66d
ENV SFCGAL_GIT_HASH=6d4465a79314aafcac973d64a9375532cab6ab4f
RUN set -ex \
&& mkdir -p /usr/src \
&& cd /usr/src \
Expand Down Expand Up @@ -149,7 +149,7 @@ RUN set -ex \
&& rm -fr /usr/src/cgal

# PROJ.
ENV PROJ_GIT_HASH=294069aa3e068036e30c6d0346949084db5d48d3
ENV PROJ_GIT_HASH=890f8a0599ee4600344c8b630df5e4bc4762c83f
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/OSGeo/PROJ.git \
Expand Down Expand Up @@ -182,7 +182,7 @@ RUN set -ex \
&& rm -fr /usr/src/PROJ

# GEOS.
ENV GEOS_GIT_HASH=8bace6161f6593643e45875d7972247699357720
ENV GEOS_GIT_HASH=06da4f3a7808288b3aef036aed02c866038985ad
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/libgeos/geos.git \
Expand All @@ -198,7 +198,7 @@ RUN set -ex \
&& rm -fr /usr/src/geos

# GDAL.
ENV GDAL_GIT_HASH=fa1fc3c77e75787c614e12a2ba5ac366db833e1f
ENV GDAL_GIT_HASH=a077f4a553b53bb2d1364259d3018201d11f882a
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/OSGeo/gdal.git \
Expand Down Expand Up @@ -345,11 +345,11 @@ COPY --from=builder /usr/local /usr/local

ARG CGAL_GIT_BRANCH
ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH}
ENV CGAL_GIT_HASH=ffd0b3a7d7dcc53ed260d513df01a9f7b7c2ae33
ENV SFCGAL_GIT_HASH=ac4942f2ef2ea201533586e4efe47b04afc64f77
ENV PROJ_GIT_HASH=294069aa3e068036e30c6d0346949084db5d48d3
ENV GEOS_GIT_HASH=8bace6161f6593643e45875d7972247699357720
ENV GDAL_GIT_HASH=fa1fc3c77e75787c614e12a2ba5ac366db833e1f
ENV CGAL_GIT_HASH=2cc6fe7ba2744e7918341a8cb7e0820a06e1d66d
ENV SFCGAL_GIT_HASH=6d4465a79314aafcac973d64a9375532cab6ab4f
ENV PROJ_GIT_HASH=890f8a0599ee4600344c8b630df5e4bc4762c83f
ENV GEOS_GIT_HASH=06da4f3a7808288b3aef036aed02c866038985ad
ENV GDAL_GIT_HASH=a077f4a553b53bb2d1364259d3018201d11f882a

# Minimal command-line smoke test (fail fast).
RUN set -ex \
Expand All @@ -368,7 +368,7 @@ RUN set -ex \
|| echo "ogr2ogr missing PostgreSQL driver" && exit 1

# Install PostGIS and companion development extensions.
ENV POSTGIS_GIT_HASH=625d3e52118717383edff7b3b94026e706ae4e98
ENV POSTGIS_GIT_HASH=c87677a620f814978f9eb3dced943c2b1241d149
ENV H3_PG_GIT_HASH=f960a574eab6aebd186dedff6204711c21742f12
ENV ADDRESS_STANDARDIZER_GIT_HASH=ba9a26a013f23908657bb26574ae436b11d4b811

Expand Down
4 changes: 2 additions & 2 deletions 18-3.7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
FROM docker.io/postgres:18-trixie

LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS 3.7.0+dfsg-1.pgdg13+1 spatial database extension with PostgreSQL 18 trixie" \
org.opencontainers.image.description="PostGIS 3.7.0+dfsg-1.pgdg13+2 spatial database extension with PostgreSQL 18 trixie" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"

ENV POSTGIS_MAJOR=3
ENV POSTGIS_VERSION=3.7.0+dfsg-1.pgdg13+1
ENV POSTGIS_VERSION=3.7.0+dfsg-1.pgdg13+2

RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
Expand Down
22 changes: 11 additions & 11 deletions 18-master/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ RUN set -ex \
# CGAL and SFCGAL.
ARG CGAL_GIT_BRANCH
ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH}
ENV CGAL_GIT_HASH=ffd0b3a7d7dcc53ed260d513df01a9f7b7c2ae33
ENV SFCGAL_GIT_HASH=ac4942f2ef2ea201533586e4efe47b04afc64f77
ENV CGAL_GIT_HASH=2cc6fe7ba2744e7918341a8cb7e0820a06e1d66d
ENV SFCGAL_GIT_HASH=6d4465a79314aafcac973d64a9375532cab6ab4f
RUN set -ex \
&& mkdir -p /usr/src \
&& cd /usr/src \
Expand Down Expand Up @@ -149,7 +149,7 @@ RUN set -ex \
&& rm -fr /usr/src/cgal

# PROJ.
ENV PROJ_GIT_HASH=294069aa3e068036e30c6d0346949084db5d48d3
ENV PROJ_GIT_HASH=890f8a0599ee4600344c8b630df5e4bc4762c83f
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/OSGeo/PROJ.git \
Expand Down Expand Up @@ -182,7 +182,7 @@ RUN set -ex \
&& rm -fr /usr/src/PROJ

# GEOS.
ENV GEOS_GIT_HASH=8bace6161f6593643e45875d7972247699357720
ENV GEOS_GIT_HASH=06da4f3a7808288b3aef036aed02c866038985ad
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/libgeos/geos.git \
Expand All @@ -198,7 +198,7 @@ RUN set -ex \
&& rm -fr /usr/src/geos

# GDAL.
ENV GDAL_GIT_HASH=fa1fc3c77e75787c614e12a2ba5ac366db833e1f
ENV GDAL_GIT_HASH=a077f4a553b53bb2d1364259d3018201d11f882a
RUN set -ex \
&& cd /usr/src \
&& git clone https://github.com/OSGeo/gdal.git \
Expand Down Expand Up @@ -345,11 +345,11 @@ COPY --from=builder /usr/local /usr/local

ARG CGAL_GIT_BRANCH
ENV CGAL_GIT_BRANCH=${CGAL_GIT_BRANCH}
ENV CGAL_GIT_HASH=ffd0b3a7d7dcc53ed260d513df01a9f7b7c2ae33
ENV SFCGAL_GIT_HASH=ac4942f2ef2ea201533586e4efe47b04afc64f77
ENV PROJ_GIT_HASH=294069aa3e068036e30c6d0346949084db5d48d3
ENV GEOS_GIT_HASH=8bace6161f6593643e45875d7972247699357720
ENV GDAL_GIT_HASH=fa1fc3c77e75787c614e12a2ba5ac366db833e1f
ENV CGAL_GIT_HASH=2cc6fe7ba2744e7918341a8cb7e0820a06e1d66d
ENV SFCGAL_GIT_HASH=6d4465a79314aafcac973d64a9375532cab6ab4f
ENV PROJ_GIT_HASH=890f8a0599ee4600344c8b630df5e4bc4762c83f
ENV GEOS_GIT_HASH=06da4f3a7808288b3aef036aed02c866038985ad
ENV GDAL_GIT_HASH=a077f4a553b53bb2d1364259d3018201d11f882a

# Minimal command-line smoke test (fail fast).
RUN set -ex \
Expand All @@ -368,7 +368,7 @@ RUN set -ex \
|| echo "ogr2ogr missing PostgreSQL driver" && exit 1

# Install PostGIS and companion development extensions.
ENV POSTGIS_GIT_HASH=625d3e52118717383edff7b3b94026e706ae4e98
ENV POSTGIS_GIT_HASH=c87677a620f814978f9eb3dced943c2b1241d149
ENV H3_PG_GIT_HASH=f960a574eab6aebd186dedff6204711c21742f12
ENV ADDRESS_STANDARDIZER_GIT_HASH=ba9a26a013f23908657bb26574ae436b11d4b811

Expand Down
Loading