Merge pull request #1345 from infosiftr/conditional-jit

Only install 18+ JIT package on architectures where it's supported
This commit is contained in:
yosifkit 2025-06-09 15:02:10 -07:00 committed by GitHub
commit 38b3c10a48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 8 deletions

View File

@ -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/*; \
\

View File

@ -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/*; \
\

View File

@ -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" \
{{ ) else "" end -}}
; \
{{ if .major >= 18 then ( -}}
# 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/*; \
\