Skip to content

Commit 97534fd

Browse files
committed
Removed gosu from replication.sh updated postgres
Something has changed in recent versions of the postgres image that breaks the use of gosu (or rather, makes it useless). See docker-library/postgres#269. It created an error when the script was creating a slave instnace (see issue nebirhos#4). Also updated the Dockerfile to use the 9.6 version of the Docker image.
1 parent 6a35e36 commit 97534fd

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

20-replication.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ if [ $REPLICATION_ROLE = "master" ]; then
77
elif [ $REPLICATION_ROLE = "slave" ]; then
88
# stop postgres instance and reset PGDATA,
99
# confs will be copied by pg_basebackup
10-
gosu postgres pg_ctl -D "$PGDATA" -m fast -w stop
10+
pg_ctl -D "$PGDATA" -m fast -w stop
1111
# make sure standby's data directory is empty
1212
rm -r "$PGDATA"/*
1313

14-
gosu postgres pg_basebackup \
14+
pg_basebackup \
1515
--write-recovery-conf \
1616
--pgdata="$PGDATA" \
1717
--xlog-method=fetch \
@@ -22,7 +22,7 @@ elif [ $REPLICATION_ROLE = "slave" ]; then
2222
--verbose
2323

2424
# useless postgres start to fullfil docker-entrypoint.sh stop
25-
gosu postgres pg_ctl -D "$PGDATA" \
25+
pg_ctl -D "$PGDATA" \
2626
-o "-c listen_addresses=''" \
2727
-w start
2828
fi

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- mode: conf -*-
2-
FROM postgres:9.5
2+
FROM postgres:9.6
33

44
55

0 commit comments

Comments
 (0)