Skip to content

Commit 4855256

Browse files
authored
feat(docker): upgrade psql to 18 (#593)
* feat: upgrade psql to 18 Instead of relying on the one packaged for the version of the ubuntu image being used. This is good for a few reasons: * pins the version of psql so it can be controlled * upgrades from 16 to 18 to resolve a few issues and unlock others * use env var for postgres version * leave curl in the image
1 parent 869d56c commit 4855256

6 files changed

Lines changed: 22 additions & 14 deletions

File tree

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,18 @@ RUN source ~/.cargo/env && \
2020

2121
FROM ubuntu:latest
2222
ENV RUST_LOG=info
23+
ENV PSQL_VERSION=18
2324
RUN apt update && \
24-
apt install -y ca-certificates postgresql-client ssl-cert && \
25+
apt install -y curl ca-certificates ssl-cert && \
2526
update-ca-certificates
2627

28+
RUN install -d /usr/share/postgresql-common/pgdg && \
29+
curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail https://www.postgresql.org/media/keys/ACCC4CF8.asc && \
30+
. /etc/os-release && \
31+
sh -c "echo 'deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $VERSION_CODENAME-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
32+
33+
RUN apt update && apt install -y postgresql-client-${PSQL_VERSION}
34+
2735
COPY --from=builder /build/target/release/pgdog /usr/local/bin/pgdog
2836

2937
WORKDIR /pgdog

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@ services:
1111
environment:
1212
RUST_LOG: debug
1313
shard_0:
14-
image: postgres:17
14+
image: postgres:18
1515
environment:
1616
POSTGRES_PASSWORD: postgres
1717
volumes:
1818
- ./docker/setup.sql:/docker-entrypoint-initdb.d/setup.sql
1919
networks:
2020
- postgres
2121
shard_1:
22-
image: postgres:17
22+
image: postgres:18
2323
environment:
2424
POSTGRES_PASSWORD: postgres
2525
networks:
2626
- postgres
2727
volumes:
2828
- ./docker/setup.sql:/docker-entrypoint-initdb.d/setup.sql
2929
shard_2:
30-
image: postgres:17
30+
image: postgres:18
3131
environment:
3232
POSTGRES_PASSWORD: postgres
3333
networks:

examples/demo/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
services:
22
db_0:
3-
image: postgres:16
3+
image: postgres:18
44
environment:
55
POSTGRES_PASSWORD: postgres
66
ports:
77
- 6000:5432
88
volumes:
99
- shard_0:/var/lib/postgresql/data
1010
db_1:
11-
image: postgres:16
11+
image: postgres:18
1212
environment:
1313
POSTGRES_PASSWORD: postgres
1414
ports:
1515
- 6001:5432
1616
volumes:
1717
- shard_1:/var/lib/postgresql/data
1818
db_2:
19-
image: postgres:16
19+
image: postgres:18
2020
environment:
2121
POSTGRES_PASSWORD: postgres
2222
ports:

examples/multi_tenant/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
services:
22
shard_0:
3-
image: postgres:17
3+
image: postgres:18
44
environment:
55
POSTGRES_PASSWORD: postgres
66
ports:
77
- 6000:5432
88
volumes:
99
- shard_0:/var/lib/postgresql/data
1010
shard_1:
11-
image: postgres:17
11+
image: postgres:18
1212
environment:
1313
POSTGRES_PASSWORD: postgres
1414
ports:
1515
- 6001:5432
1616
volumes:
1717
- shard_1:/var/lib/postgresql/data
1818
shard_2:
19-
image: postgres:17
19+
image: postgres:18
2020
environment:
2121
POSTGRES_PASSWORD: postgres
2222
ports:

examples/pgbouncer_benchmark/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
postgres:
3-
image: postgres:17
3+
image: postgres:18
44
environment:
55
POSTGRES_PASSWORD: postgres
66
pgbouncer:

integration/load_balancer/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
services:
22
primary:
3-
image: postgres:17
3+
image: postgres:18
44
environment:
55
POSTGRES_PASSWORD: postgres
66
volumes:
77
- ./docker/primary.sh:/docker-entrypoint-initdb.d/setup.sh
88
ports:
99
- 45000:5432
1010
replica_1:
11-
image: postgres:17
11+
image: postgres:18
1212
environment:
1313
POSTGRES_PASSWORD: postgres
1414
volumes:
@@ -20,7 +20,7 @@ services:
2020
ports:
2121
- 45001:5432
2222
replica_2:
23-
image: postgres:17
23+
image: postgres:18
2424
environment:
2525
POSTGRES_PASSWORD: postgres
2626
volumes:

0 commit comments

Comments
 (0)