Skip to content

Commit 316a693

Browse files
naorpeledclaude
andcommitted
fix: replace deprecated apt-key with signed-by for PGDG repo
apt-key was removed in Debian trixie, which newer postgres base images now use, causing Docker builds to fail with "apt-key: not found". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a069979 commit 316a693

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ RUN apt-get update \
2626
gnupg \
2727
ca-certificates \
2828
wget \
29-
# Add PostgreSQL official repository
30-
&& sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' \
31-
&& wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
29+
# Add PostgreSQL official repository using signed-by (apt-key is removed in newer Debian)
30+
&& wget --quiet -O /usr/share/keyrings/postgresql-archive-keyring.gpg https://www.postgresql.org/media/keys/ACCC4CF8.asc \
31+
&& sh -c 'echo "deb [signed-by=/usr/share/keyrings/postgresql-archive-keyring.gpg] http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' \
3232
# Update package lists again after adding the new repository
3333
&& apt-get update \
3434
# Install build tools and PostgreSQL development packages from PGDG

0 commit comments

Comments
 (0)