diff --git a/18/bookworm/Dockerfile b/18/bookworm/Dockerfile index 88e36344e0..0cf4c0fb08 100644 --- a/18/bookworm/Dockerfile +++ b/18/bookworm/Dockerfile @@ -156,9 +156,11 @@ RUN set -ex; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ -# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+) - "postgresql-$PG_MAJOR-jit=$PG_VERSION" \ ; \ +# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+, but only supported for a subset of architectures) + if apt-get install -s "postgresql-$PG_MAJOR-jit" > /dev/null 2>&1; then \ + apt-get install -y --no-install-recommends "postgresql-$PG_MAJOR-jit=$PG_VERSION"; \ + fi; \ \ rm -rf /var/lib/apt/lists/*; \ \ diff --git a/18/bullseye/Dockerfile b/18/bullseye/Dockerfile index b2ec63d5b9..2a4b74b9ff 100644 --- a/18/bullseye/Dockerfile +++ b/18/bullseye/Dockerfile @@ -156,9 +156,11 @@ RUN set -ex; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ -# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+) - "postgresql-$PG_MAJOR-jit=$PG_VERSION" \ ; \ +# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+, but only supported for a subset of architectures) + if apt-get install -s "postgresql-$PG_MAJOR-jit" > /dev/null 2>&1; then \ + apt-get install -y --no-install-recommends "postgresql-$PG_MAJOR-jit=$PG_VERSION"; \ + fi; \ \ rm -rf /var/lib/apt/lists/*; \ \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index de0ea03974..81a6a0a0c5 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -154,11 +154,13 @@ RUN set -ex; \ sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf; \ apt-get install -y --no-install-recommends \ "postgresql-$PG_MAJOR=$PG_VERSION" \ + ; \ {{ if .major >= 18 then ( -}} -# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+) - "postgresql-$PG_MAJOR-jit=$PG_VERSION" \ +# https://github.com/docker-library/postgres/pull/1344#issuecomment-2936578203 (JIT is a separate package in 18+, but only supported for a subset of architectures) + if apt-get install -s "postgresql-$PG_MAJOR-jit" > /dev/null 2>&1; then \ + apt-get install -y --no-install-recommends "postgresql-$PG_MAJOR-jit=$PG_VERSION"; \ + fi; \ {{ ) else "" end -}} - ; \ \ rm -rf /var/lib/apt/lists/*; \ \