Skip to content

Commit 70b6853

Browse files
committed
feat: Upgrade to postgres 17.2
1 parent 9c1a9bb commit 70b6853

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ENV PATH="$PATH:/usr/lib/postgresql/17/bin:/scripts"
2323
ENV WALG_CONFIG_FILE=/var/lib/postgresql/.walg.json
2424
ENV LANG en_US.utf8
2525

26-
COPY --from=postgres:17.0 /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
26+
COPY --from=postgres:17.2 /usr/local/bin/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
2727
ADD ./scripts /scripts
2828

2929
STOPSIGNAL SIGINT

Dockerfile.upgrade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM livingdocs/postgres:17.0
1+
FROM livingdocs/postgres:17.2
22
USER root
33
RUN set -e \
44
export DEBIAN_FRONTEND=noninteractive && \

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [Postgres 17.0](https://github.com/livingdocsIO/dockerfile-postgres) [![](https://img.shields.io/badge/docker-livingdocs%2Fpostgres-blue)](https://hub.docker.com/r/livingdocs/postgres)
1+
# [Postgres 17.2](https://github.com/livingdocsIO/dockerfile-postgres) [![](https://img.shields.io/badge/docker-livingdocs%2Fpostgres-blue)](https://hub.docker.com/r/livingdocs/postgres)
22

33
- Based on Debian
44
- Includes `postgres-contrib`, enables the extensions `pg_stat_statements` by default
@@ -13,7 +13,7 @@
1313

1414
```bash
1515
# Secured with a password, by default the image is secure
16-
docker run -d --name postgres -p 5432:5432 -v postgres:/var/lib/postgresql -e POSTGRES_PASSWORD=somepassword livingdocs/postgres:17.0
16+
docker run -d --name postgres -p 5432:5432 -v postgres:/var/lib/postgresql -e POSTGRES_PASSWORD=somepassword livingdocs/postgres:17.2
1717
```
1818

1919
## Upgrade an existing postgres container
@@ -24,42 +24,42 @@ docker run -d --name postgres -p 5432:5432 -v postgres:/var/lib/postgresql livin
2424

2525
# First stop it, then run the upgrade image
2626
docker stop postgres
27-
docker run --rm -v postgres:/var/lib/postgresql livingdocs/postgres:17.0-upgrade
27+
docker run --rm -v postgres:/var/lib/postgresql livingdocs/postgres:17.2-upgrade
2828

2929
# After it succeeds, you can run the new image and mount the existing volume
30-
docker run -d --name postgres -p 5432:5432 -v postgres:/var/lib/postgresql livingdocs/postgres:17.0
30+
docker run -d --name postgres -p 5432:5432 -v postgres:/var/lib/postgresql livingdocs/postgres:17.2
3131
```
3232

3333
## To build this image manually
3434

3535
```bash
36-
docker build -t livingdocs/postgres:17.0 .
36+
docker build -t livingdocs/postgres:17.2 .
3737
```
3838

3939
With buildx on docker
4040
```bash
4141
# To build and push the multi-arch manifest to docker hub
42-
docker buildx build --platform linux/amd64,linux/arm64 -t livingdocs/postgres:17.0 --push .
42+
docker buildx build --platform linux/amd64,linux/arm64 -t livingdocs/postgres:17.2 --push .
4343

44-
docker buildx build --platform linux/amd64,linux/arm64 -t livingdocs/postgres:17.0-upgrade --push -f Dockerfile.upgrade .
44+
docker buildx build --platform linux/amd64,linux/arm64 -t livingdocs/postgres:17.2-upgrade --push -f Dockerfile.upgrade .
4545
```
4646

4747
With nerdctl on lima/containerd
4848
```bash
49-
nerdctl build --platform=amd64,arm64 -t livingdocs/postgres:17.0 .
50-
nerdctl build --platform=amd64,arm64 -t livingdocs/postgres:17.0-upgrade -f Dockerfile.upgrade .
49+
nerdctl build --platform=amd64,arm64 -t livingdocs/postgres:17.2 .
50+
nerdctl build --platform=amd64,arm64 -t livingdocs/postgres:17.2-upgrade -f Dockerfile.upgrade .
5151

52-
lima nerdctl push --all-platforms livingdocs/postgres:17.0
53-
lima nerdctl push --all-platforms livingdocs/postgres:17.0-upgrade
52+
lima nerdctl push --all-platforms livingdocs/postgres:17.2
53+
lima nerdctl push --all-platforms livingdocs/postgres:17.2-upgrade
5454
```
5555

5656
## Set up streaming replication
5757

5858
### Simple setup
5959
```bash
6060
# Create the containers
61-
docker run -d -p 5433:5432 --name postgres-1 livingdocs/postgres:17.0
62-
docker run -d -p 5434:5432 --name postgres-2 livingdocs/postgres:17.0 standby -d "host=host.docker.internal port=5433 user=postgres target_session_attrs=read-write"
61+
docker run -d -p 5433:5432 --name postgres-1 livingdocs/postgres:17.2
62+
docker run -d -p 5434:5432 --name postgres-2 livingdocs/postgres:17.2 standby -d "host=host.docker.internal port=5433 user=postgres target_session_attrs=read-write"
6363

6464
# Test the replication
6565
docker exec postgres-1 psql -c "CREATE TABLE hello (value text); INSERT INTO hello(value) VALUES('world');"
@@ -77,7 +77,7 @@ docker exec postgres-2 psql -c "SELECT * FROM hello;"
7777
docker network create local
7878

7979
# First create the database primary
80-
docker run -d -p 5433:5432 --name postgres-1 --network=local --network-alias=postgres -e POSTGRES_HOST_AUTH_METHOD=md5 livingdocs/postgres:17.0
80+
docker run -d -p 5433:5432 --name postgres-1 --network=local --network-alias=postgres -e POSTGRES_HOST_AUTH_METHOD=md5 livingdocs/postgres:17.2
8181

8282
# Create the users on database intialization
8383
# You could also mount an sql or script into /var/lib/postgresql/initdb.d during cluster startup to execute the script automatically.
@@ -86,8 +86,8 @@ docker exec postgres-1 psql -c "CREATE USER replication REPLICATION LOGIN ENCRYP
8686

8787
# The launch the replicas
8888
export DB_URL="host=postgres port=5432 user=replication password=some-replication-password target_session_attrs=read-write"
89-
docker run -d -p 5434:5432 --name postgres-2 --network=local --network-alias=postgres livingdocs/postgres:17.0 standby -d $DB_URL
90-
docker run -d -p 5435:5432 --name postgres-3 --network=local --network-alias=postgres livingdocs/postgres:17.0 standby -d $DB_URL
89+
docker run -d -p 5434:5432 --name postgres-2 --network=local --network-alias=postgres livingdocs/postgres:17.2 standby -d $DB_URL
90+
docker run -d -p 5435:5432 --name postgres-3 --network=local --network-alias=postgres livingdocs/postgres:17.2 standby -d $DB_URL
9191

9292
# Test the replication
9393
docker exec postgres-1 psql -c "CREATE TABLE hello (value text); INSERT INTO hello(value) VALUES('hello');"

scripts/postgres-install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor > /e
1919
apt-get update
2020
apt-get install -y --no-install-recommends postgresql-common
2121
sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf
22-
apt-get install -y --no-install-recommends "postgresql-17=17.0-1.pgdg120+1"
22+
apt-get install -y --no-install-recommends "postgresql-17=17.2-1.pgdg120+1"
2323

2424
>&2 echo 'Install pg_auto_failover'
2525
apt-get install -y --no-install-recommends pg-auto-failover-cli postgresql-17-auto-failover

0 commit comments

Comments
 (0)