Skip to content

Commit 2b66b21

Browse files
eschen42tbeadle
authored andcommitted
restore runnability for pg < 9.4
1 parent 9fec7f3 commit 2b66b21

24 files changed

+76
-24
lines changed

9.2/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RUN set -ex; \
3939

4040
ENV \
4141
PG_MAJOR=9.2 \
42-
PG_VERSION=9.2.20-1.pgdg80+1 \
42+
PG_VERSION=9.2.21-1.pgdg80+1 \
4343
PATH=/usr/lib/postgresql/9.2/bin:$PATH \
4444
PGDATA=/var/lib/postgresql/data
4545

9.2/alpine/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ENV LANG en_US.utf8
1414
RUN mkdir /docker-entrypoint-initdb.d
1515

1616
ENV PG_MAJOR 9.2
17-
ENV PG_VERSION 9.2.20
18-
ENV PG_SHA256 0b8abdae8400cabea5587a726003c9dd71c73c049bdae523abc35f9312dd8f26
17+
ENV PG_VERSION 9.2.21
18+
ENV PG_SHA256 0697e843523ee60c563f987f9c65bc4201294b18525d6e5e4b2c50c6d4058ef9
1919

2020
RUN set -ex \
2121
\

9.2/functions.sh

+4
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ verlte() {
3030
verlt() {
3131
[ "$1" == "$2" ] && return 1 || verlte $1 $2
3232
}
33+
34+
major_gte() { verlt $1 ${PG_MAJOR}; }
35+
major_lt() { verlt ${PG_MAJOR} $1; }
36+

9.3/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RUN set -ex; \
3939

4040
ENV \
4141
PG_MAJOR=9.3 \
42-
PG_VERSION=9.3.16-1.pgdg80+1 \
42+
PG_VERSION=9.3.17-1.pgdg80+1 \
4343
PATH=/usr/lib/postgresql/9.3/bin:$PATH \
4444
PGDATA=/var/lib/postgresql/data
4545

9.3/alpine/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ENV LANG en_US.utf8
1414
RUN mkdir /docker-entrypoint-initdb.d
1515

1616
ENV PG_MAJOR 9.3
17-
ENV PG_VERSION 9.3.16
18-
ENV PG_SHA256 845f5e4ac8cf026b6a77c5a180a2fe869f51e9d06acf8d0365b05505a2c66873
17+
ENV PG_VERSION 9.3.17
18+
ENV PG_SHA256 9c03e5f280cfe9bd202fa01af773eb146abd8ab3065f7279d574c568f6948dbe
1919

2020
RUN set -ex \
2121
\

9.3/functions.sh

+4
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ verlte() {
3030
verlt() {
3131
[ "$1" == "$2" ] && return 1 || verlte $1 $2
3232
}
33+
34+
major_gte() { verlt $1 ${PG_MAJOR}; }
35+
major_lt() { verlt ${PG_MAJOR} $1; }
36+

9.4/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RUN set -ex; \
3939

4040
ENV \
4141
PG_MAJOR=9.4 \
42-
PG_VERSION=9.4.11-1.pgdg80+1 \
42+
PG_VERSION=9.4.12-1.pgdg80+1 \
4343
PATH=/usr/lib/postgresql/9.4/bin:$PATH \
4444
PGDATA=/var/lib/postgresql/data
4545

9.4/alpine/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ENV LANG en_US.utf8
1414
RUN mkdir /docker-entrypoint-initdb.d
1515

1616
ENV PG_MAJOR 9.4
17-
ENV PG_VERSION 9.4.11
18-
ENV PG_SHA256 e3eb51d045c180b03d2de1f0c3af9356e10be49448e966ca01dfc2c6d1cc9d23
17+
ENV PG_VERSION 9.4.12
18+
ENV PG_SHA256 fca055481875d1c49e31c28443f56472a1474b3fbe25b7ae64440c6118f82e64
1919

2020
RUN set -ex \
2121
\

9.4/functions.sh

+4
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ verlte() {
3030
verlt() {
3131
[ "$1" == "$2" ] && return 1 || verlte $1 $2
3232
}
33+
34+
major_gte() { verlt $1 ${PG_MAJOR}; }
35+
major_lt() { verlt ${PG_MAJOR} $1; }
36+

9.5/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RUN set -ex; \
3939

4040
ENV \
4141
PG_MAJOR=9.5 \
42-
PG_VERSION=9.5.6-1.pgdg80+1 \
42+
PG_VERSION=9.5.7-1.pgdg80+1 \
4343
PATH=/usr/lib/postgresql/9.5/bin:$PATH \
4444
PGDATA=/var/lib/postgresql/data
4545

9.5/alpine/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ENV LANG en_US.utf8
1414
RUN mkdir /docker-entrypoint-initdb.d
1515

1616
ENV PG_MAJOR 9.5
17-
ENV PG_VERSION 9.5.6
18-
ENV PG_SHA256 bb9e5f6d34e20783e96e10c1d6c0c09c31749e802aaa46b793ce2522725ae12f
17+
ENV PG_VERSION 9.5.7
18+
ENV PG_SHA256 8b1e936f82109325decc0f5575e846b93fb4fd384e8c4bde83ff5e7f87fc6cad
1919

2020
RUN set -ex \
2121
\

9.5/functions.sh

+4
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ verlte() {
3030
verlt() {
3131
[ "$1" == "$2" ] && return 1 || verlte $1 $2
3232
}
33+
34+
major_gte() { verlt $1 ${PG_MAJOR}; }
35+
major_lt() { verlt ${PG_MAJOR} $1; }
36+

9.6/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RUN set -ex; \
3939

4040
ENV \
4141
PG_MAJOR=9.6 \
42-
PG_VERSION=9.6.2-1.pgdg80+1 \
42+
PG_VERSION=9.6.3-1.pgdg80+1 \
4343
PATH=/usr/lib/postgresql/9.6/bin:$PATH \
4444
PGDATA=/var/lib/postgresql/data
4545

9.6/alpine/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ ENV LANG en_US.utf8
1414
RUN mkdir /docker-entrypoint-initdb.d
1515

1616
ENV PG_MAJOR 9.6
17-
ENV PG_VERSION 9.6.2
18-
ENV PG_SHA256 0187b5184be1c09034e74e44761505e52357248451b0c854dddec6c231fe50c9
17+
ENV PG_VERSION 9.6.3
18+
ENV PG_SHA256 1645b3736901f6d854e695a937389e68ff2066ce0cde9d73919d6ab7c995b9c6
1919

2020
RUN set -ex \
2121
\

9.6/functions.sh

+4
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ verlte() {
3030
verlt() {
3131
[ "$1" == "$2" ] && return 1 || verlte $1 $2
3232
}
33+
34+
major_gte() { verlt $1 ${PG_MAJOR}; }
35+
major_lt() { verlt ${PG_MAJOR} $1; }
36+

barman/Dockerfile-9.2

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM tbeadle/postgres:9.2
22

3+
# explicitly set user/group IDs
4+
RUN install -d -m 0700 -o postgres -g postgres /home/postgres
5+
36
RUN apt-get update \
47
&& apt-get install -y --no-install-recommends \
58
openssh-server \

barman/Dockerfile-9.3

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM tbeadle/postgres:9.3
22

3+
# explicitly set user/group IDs
4+
RUN install -d -m 0700 -o postgres -g postgres /home/postgres
5+
36
RUN apt-get update \
47
&& apt-get install -y --no-install-recommends \
58
openssh-server \

barman/Dockerfile-9.4

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM tbeadle/postgres:9.4
22

3+
# explicitly set user/group IDs
4+
RUN install -d -m 0700 -o postgres -g postgres /home/postgres
5+
36
RUN apt-get update \
47
&& apt-get install -y --no-install-recommends \
58
openssh-server \

barman/Dockerfile-9.5

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM tbeadle/postgres:9.5
22

3+
# explicitly set user/group IDs
4+
RUN install -d -m 0700 -o postgres -g postgres /home/postgres
5+
36
RUN apt-get update \
47
&& apt-get install -y --no-install-recommends \
58
openssh-server \

barman/Dockerfile-9.6

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM tbeadle/postgres:9.6
22

3+
# explicitly set user/group IDs
4+
RUN install -d -m 0700 -o postgres -g postgres /home/postgres
5+
36
RUN apt-get update \
47
&& apt-get install -y --no-install-recommends \
58
openssh-server \

barman/Dockerfile.template

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM tbeadle/postgres:%%PG_MAJOR%%
22

3+
# explicitly set user/group IDs
4+
RUN install -d -m 0700 -o postgres -g postgres /home/postgres
5+
36
RUN apt-get update \
47
&& apt-get install -y --no-install-recommends \
58
openssh-server \

barman/image-entrypoint-initdb.d/02_create_replication_slot.sh

+11-6
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
set -eo pipefail
44

5-
if [[ -n ${BARMAN_SLOT_NAME} ]]; then
6-
echo "Creating replication slot '${BARMAN_SLOT_NAME}' for barman."
7-
psql -v ON_ERROR_STOP=1 -c "SELECT * FROM pg_create_physical_replication_slot('${BARMAN_SLOT_NAME//\'/\'\'}');"
8-
else
9-
echo "BARMAN_SLOT_NAME is empty; not creating replication slot."
10-
fi
5+
. /usr/local/bin/functions.sh
6+
7+
if not verlt ${PG_MAJOR} 9.4; then
8+
if [[ -n ${BARMAN_SLOT_NAME} ]]; then
9+
echo "Creating replication slot '${BARMAN_SLOT_NAME}' for barman."
10+
psql -v ON_ERROR_STOP=1 -c "SELECT * FROM pg_create_physical_replication_slot('${BARMAN_SLOT_NAME//\'/\'\'}');"
11+
else
12+
echo "BARMAN_SLOT_NAME is empty; not creating replication slot."
13+
fi
14+
fi
15+

barman/image-pre-start.d/01_update_postgresql.conf.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@ set -eo pipefail
55
. /usr/local/bin/functions.sh
66

77
echo "Updating postgresql.conf to allow for streaming replication"
8-
if verlt ${PG_MAJOR} 9.6; then
9-
WAL_LEVEL="hot_standby"
10-
else
8+
if major_gte 9.6; then
119
WAL_LEVEL="replica"
10+
else
11+
WAL_LEVEL="hot_standby"
1212
fi
1313

1414
cat >>${PGDATA}/postgresql.conf <<EOF
1515
wal_level = '${WAL_LEVEL}'
1616
max_wal_senders = 2
17+
EOF
18+
19+
if major_gte 9.4 ; then
20+
cat >>${PGDATA}/postgresql.conf <<EOF
1721
max_replication_slots = 2
1822
EOF
23+
fi

functions.sh

+4
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ verlte() {
3030
verlt() {
3131
[ "$1" == "$2" ] && return 1 || verlte $1 $2
3232
}
33+
34+
major_gte() { verlt $1 ${PG_MAJOR}; }
35+
major_lt() { verlt ${PG_MAJOR} $1; }
36+

0 commit comments

Comments
 (0)