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
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
2626docker 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
3939With 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
4747With 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
6565docker 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;"
7777docker 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
8888export 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
9393docker exec postgres-1 psql -c " CREATE TABLE hello (value text); INSERT INTO hello(value) VALUES('hello');"
0 commit comments