Skip to content

Commit a96a421

Browse files
committed
Update to Debian Bookworm, drop deprecated apt-key usage
1 parent 5af15c8 commit a96a421

File tree

9 files changed

+42
-36
lines changed

9 files changed

+42
-36
lines changed

Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#
2-
# Using --build-arg PGVERSION=14 we can build pg_auto_failover for any
2+
# Using --build-arg PGVERSION=17 we can build pg_auto_failover for any
33
# target version of Postgres. In the Makefile, we use that to our advantage
44
# and tag test images such as pg_auto_failover_test:pg14.
55
#
6-
ARG PGVERSION=14
6+
ARG PGVERSION=17
77

88
#
99
# Define a base image with all our build dependencies.
1010
#
1111
# This base image contains all our target Postgres versions.
1212
#
13-
FROM debian:bullseye-slim AS base
13+
FROM debian:bookworm-slim AS base
1414

1515
ARG PGVERSION
1616

@@ -63,8 +63,8 @@ RUN apt-get update \
6363
postgresql-common \
6464
&& rm -rf /var/lib/apt/lists/*
6565

66-
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
67-
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
66+
RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
67+
RUN echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
6868

6969
# bypass initdb of a "main" cluster
7070
RUN echo 'create_main_cluster = false' | sudo tee -a /etc/postgresql-common/createcluster.conf
@@ -84,7 +84,7 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
8484
FROM base AS citus
8585

8686
ARG PGVERSION
87-
ARG CITUSTAG=v11.1.2
87+
ARG CITUSTAG=v13.0.0
8888

8989
ENV PG_CONFIG=/usr/lib/postgresql/${PGVERSION}/bin/pg_config
9090

@@ -136,7 +136,7 @@ ENV PATH /usr/lib/postgresql/${PGVERSION}/bin:/usr/local/sbin:/usr/local/bin:/us
136136
#
137137
# And finally our "run" images with the bare minimum for run-time.
138138
#
139-
FROM debian:bullseye-slim AS run
139+
FROM debian:bookworm-slim AS run
140140

141141
ARG PGVERSION
142142

@@ -160,8 +160,8 @@ RUN apt-get update \
160160
libpq-dev \
161161
&& rm -rf /var/lib/apt/lists/*
162162

163-
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
164-
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
163+
RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
164+
RUN echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
165165

166166
# bypass initdb of a "main" cluster
167167
RUN echo 'create_main_cluster = false' | sudo tee -a /etc/postgresql-common/createcluster.conf

Dockerfile.docs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye-slim
1+
FROM debian:bookworm-slim
22

33
RUN apt-get update \
44
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ To avoid debian creating a default Postgres data directory and service,
8484
follow these steps before installing the previous packages.
8585

8686
```bash
87-
$ curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
88-
$ echo "deb http://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list
87+
$ apt install curl ca-certificates
88+
$ install -d /usr/share/postgresql-common/pgdg
89+
$ curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
90+
$ echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
8991

9092
# bypass initdb of a "main" cluster
9193
$ echo 'create_main_cluster = false' | sudo tee -a /etc/postgresql-common/createcluster.conf

docs/citus/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM debian:bullseye-slim
1+
FROM debian:bookworm-slim
22

3-
ARG PGVERSION=14
4-
ARG CITUS=postgresql-14-citus-11.1
3+
ARG PGVERSION=17
4+
ARG CITUS=postgresql-17-citus-13.0
55

66
RUN apt-get update \
77
&& apt-get install -y --no-install-recommends \
@@ -19,9 +19,9 @@ RUN apt-get update \
1919
&& rm -rf /var/lib/apt/lists/*
2020

2121
# we use apt.postgresql.org
22-
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
23-
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
24-
RUN echo "deb-src http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.src.list
22+
RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
23+
RUN echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
24+
RUN echo "deb-src [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.src.list
2525

2626
# bypass initdb of a "main" cluster
2727
RUN echo 'create_main_cluster = false' | sudo tee -a /etc/postgresql-common/createcluster.conf

docs/citus/Dockerfile.app

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye-slim
1+
FROM debian:bookworm-slim
22

33
ARG PGVERSION=14
44

@@ -17,9 +17,10 @@ RUN apt-get update \
1717
&& rm -rf /var/lib/apt/lists/*
1818

1919
# we use apt.postgresql.org
20-
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
21-
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
22-
RUN echo "deb-src http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.src.list
20+
RUN install -d /usr/share/postgresql-common/pgdg
21+
RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
22+
RUN echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
23+
RUN echo "deb-src [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.src.list
2324

2425
RUN apt-get update \
2526
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \

docs/install.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ debian package, follow those steps:
4141

4242
::
4343

44-
$ curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
45-
$ echo "deb http://apt.postgresql.org/pub/repos/apt bookworm-pgdg main" > /etc/apt/sources.list.d/pgdg.list
44+
$ apt install curl ca-certificates
45+
$ install -d /usr/share/postgresql-common/pgdg
46+
$ curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
47+
$ echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list
4648

4749
# bypass initdb of a "main" cluster
4850
$ echo 'create_main_cluster = false' | sudo tee -a /etc/postgresql-common/createcluster.conf
@@ -116,12 +118,12 @@ install`.
116118

117119
For this to work please consider adding both the binary and the source
118120
repositories to your debian distribution by using the following apt sources,
119-
as an example targetting the debian bullseye distribution:
121+
as an example targetting the debian bookworm distribution:
120122

121123
::
122124

123-
deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main
124-
deb-src http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main
125+
deb https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main
126+
deb-src https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main
125127

126128
Then we can install the build dependencies for Postgres, knowing that
127129
pg_auto_failover uses the same build dependencies:

docs/tutorial/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye-slim
1+
FROM debian:bookworm-slim
22

33
ARG PGVERSION=14
44
ARG CITUS=postgresql-14-citus-11.1
@@ -19,9 +19,9 @@ RUN apt-get update \
1919
&& rm -rf /var/lib/apt/lists/*
2020

2121
# we use apt.postgresql.org
22-
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
23-
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
24-
RUN echo "deb-src http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.src.list
22+
RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
23+
RUN echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
24+
RUN echo "deb-src [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.src.list
2525

2626
# bypass initdb of a "main" cluster
2727
RUN echo 'create_main_cluster = false' | sudo tee -a /etc/postgresql-common/createcluster.conf

docs/tutorial/Dockerfile.app

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bullseye-slim
1+
FROM debian:bookworm-slim
22

33
ARG PGVERSION=14
44

@@ -17,9 +17,10 @@ RUN apt-get update \
1717
&& rm -rf /var/lib/apt/lists/*
1818

1919
# we use apt.postgresql.org
20-
RUN curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
21-
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
22-
RUN echo "deb-src http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.src.list
20+
RUN install -d /usr/share/postgresql-common/pgdg
21+
RUN curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc
22+
RUN echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.list
23+
RUN echo "deb-src [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt bookworm-pgdg main ${PGVERSION}" > /etc/apt/sources.list.d/pgdg.src.list
2324

2425
RUN apt-get update \
2526
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \

tests/tablespaces/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG PGVERSION=14
22

3-
FROM pg_auto_failover_test:pg${PGVERSION} as test
3+
FROM pg_auto_failover_test:pg${PGVERSION} AS test
44

55
USER root
66
RUN mkdir -p /extra_volumes/extended_a && chown -R docker /extra_volumes/extended_a

0 commit comments

Comments
 (0)