# CloudNativePG-compatible PostGIS image # Uses imresamu/postgis as base which has ARM64 support FROM imresamu/postgis:16-3.4 # Get additional tools from CloudNativePG image FROM ghcr.io/cloudnative-pg/postgresql:16.6 as cnpg-tools # Final stage: PostGIS with CloudNativePG tools FROM imresamu/postgis:16-3.4 USER root # Fix user ID compatibility with CloudNativePG (user ID 26) # CloudNativePG expects postgres user to have ID 26, but imresamu/postgis uses 999 # The tape group (ID 26) already exists, so we'll change postgres user to use it RUN usermod -u 26 -g 26 postgres && \ delgroup postgres && \ chown -R postgres:tape /var/lib/postgresql && \ chown -R postgres:tape /var/run/postgresql # Copy barman and other tools from CloudNativePG image COPY --from=cnpg-tools /usr/local/bin/barman* /usr/local/bin/ # Install any additional packages that CloudNativePG might need RUN apt-get update && \ apt-get install -y --no-install-recommends \ curl \ jq \ && rm -rf /var/lib/apt/lists/* # Switch back to postgres user (now with correct ID 26) USER postgres # Keep the standard PostgreSQL entrypoint # CloudNativePG operator will manage the container lifecycle