1- # [ Postgres 14.0 ] ( https://github.com/livingdocsIO/dockerfile-postgres ) [ ![ ] ( https://shields.beevelop.com/docker/pulls/livingdocs/postgres.svg?style=flat-square )] ( https://hub.docker.com/r/livingdocs/postgres )
1+ # [ Postgres 14.1 ] ( https://github.com/livingdocsIO/dockerfile-postgres ) [ ![ ] ( https://shields.beevelop.com/docker/pulls/livingdocs/postgres.svg?style=flat-square )] ( https://hub.docker.com/r/livingdocs/postgres )
22
33- Based on Debian
44- Includes ` postgres-contrib ` , enables the extensions ` pg_stat_statements ` and ` pg_squeeze ` 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:14.0
16+ docker run -d --name postgres -p 5432:5432 -v postgres:/var/lib/postgresql -e POSTGRES_PASSWORD=somepassword livingdocs/postgres:14.1
1717```
1818
1919## Upgrade an existing postgres container
@@ -24,28 +24,28 @@ 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:14.0 -upgrade
27+ docker run --rm -v postgres:/var/lib/postgresql livingdocs/postgres:14.1 -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:14.0
30+ docker run -d --name postgres -p 5432:5432 -v postgres:/var/lib/postgresql livingdocs/postgres:14.1
3131```
3232
3333## To build this image manually
3434
3535``` bash
36- docker build -t livingdocs/postgres:14.0 .
36+ docker build -t livingdocs/postgres:14.1 .
3737
3838# To build and push the multi-arch manifest to docker hub
39- docker buildx build --platform linux/amd64,linux/arm64 -t livingdocs/postgres:14.0 --push .
39+ docker buildx build --platform linux/amd64,linux/arm64 -t livingdocs/postgres:14.1 --push .
4040```
4141
4242## Set up streaming replication
4343
4444### Simple setup
4545``` bash
4646# Create the containers
47- docker run -d -p 5433:5432 --name postgres-1 livingdocs/postgres:14.0
48- docker run -d -p 5434:5432 --name postgres-2 livingdocs/postgres:14.0 standby -d " host=host.docker.internal port=5433 user=postgres target_session_attrs=read-write"
47+ docker run -d -p 5433:5432 --name postgres-1 livingdocs/postgres:14.1
48+ docker run -d -p 5434:5432 --name postgres-2 livingdocs/postgres:14.1 standby -d " host=host.docker.internal port=5433 user=postgres target_session_attrs=read-write"
4949
5050# Test the replication
5151docker exec postgres-1 psql -c " CREATE TABLE hello (value text); INSERT INTO hello(value) VALUES('world');"
@@ -63,7 +63,7 @@ docker exec postgres-2 psql -c "SELECT * FROM hello;"
6363docker network create local
6464
6565# First create the database primary
66- docker run -d -p 5433:5432 --name postgres-1 --network=local --network-alias=postgres -e POSTGRES_HOST_AUTH_METHOD=md5 livingdocs/postgres:14.0
66+ docker run -d -p 5433:5432 --name postgres-1 --network=local --network-alias=postgres -e POSTGRES_HOST_AUTH_METHOD=md5 livingdocs/postgres:14.1
6767
6868# Create the users on database intialization
6969# You could also mount an sql or script into /var/lib/postgresql/initdb.d during cluster startup to execute the script automatically.
@@ -72,8 +72,8 @@ docker exec postgres-1 psql -c "CREATE USER replication REPLICATION LOGIN ENCRYP
7272
7373# The launch the replicas
7474export DB_URL=" host=postgres port=5432 user=replication password=some-replication-password target_session_attrs=read-write"
75- docker run -d -p 5434:5432 --name postgres-2 --network=local --network-alias=postgres livingdocs/postgres:14.0 standby -d $DB_URL
76- docker run -d -p 5435:5432 --name postgres-3 --network=local --network-alias=postgres livingdocs/postgres:14.0 standby -d $DB_URL
75+ docker run -d -p 5434:5432 --name postgres-2 --network=local --network-alias=postgres livingdocs/postgres:14.1 standby -d $DB_URL
76+ docker run -d -p 5435:5432 --name postgres-3 --network=local --network-alias=postgres livingdocs/postgres:14.1 standby -d $DB_URL
7777
7878# Test the replication
7979docker exec postgres-1 psql -c " CREATE TABLE hello (value text); INSERT INTO hello(value) VALUES('hello');"
0 commit comments