File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ elif [ $REPLICATION_ROLE = "slave" ]; then
8
8
# stop postgres instance and reset PGDATA,
9
9
# confs will be copied by pg_basebackup
10
10
gosu postgres pg_ctl -D " $PGDATA " -m fast -w stop
11
+ # make sure standby's data directory is empty
11
12
rm -r " $PGDATA " /*
12
13
13
14
gosu postgres pg_basebackup \
Original file line number Diff line number Diff line change @@ -19,5 +19,7 @@ ENV POSTGRES_MASTER_SERVICE_PORT 5432
19
19
20
20
COPY 10-config.sh /docker-entrypoint-initdb.d/
21
21
COPY 20-replication.sh /docker-entrypoint-initdb.d/
22
- # Evaluate vars inside PGDATA (eg PGDATA=/mnt/$HOSTNAME)
22
+ # Evaluate vars inside PGDATA at runtime.
23
+ # For example HOSTNAME in 'ENV PGDATA=/mnt/$HOSTNAME'
24
+ # is resolved runtime rather then during build
23
25
RUN sed -i 's/set -e/set -e -x\n PGDATA=$(eval echo "$PGDATA")/' /docker-entrypoint.sh
You can’t perform that action at this time.
0 commit comments