1
- ARG PG_SERVER_VERSION=12
1
+ ARG PG_SERVER_VERSION=14
2
2
3
3
FROM postgres:${PG_SERVER_VERSION}
4
4
LABEL maintainer="postgres.ai"
5
5
6
6
ARG PG_SERVER_VERSION
7
- ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-12 }
7
+ ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-14 }
8
8
9
9
ARG WALG_VERSION
10
10
ENV WALG_VERSION=${WALG_VERSION:-0.2.19}
11
11
12
- ENV CITUS_VERSION=9.4
13
-
14
12
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
15
13
&& apt-get update -o Acquire::CompressionTypes::Order::=gz \
16
14
&& apt-get install --no-install-recommends -y wget make gcc unzip sudo git \
17
15
curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \
18
16
build-essential libevent-dev libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils \
19
17
&& apt-get install --no-install-recommends -y \
20
18
postgresql-server-dev-${PG_SERVER_VERSION} \
21
- && apt-get install --no-install-recommends -y \
22
- postgresql-${PG_SERVER_VERSION}-repack \
19
+ && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack \
23
20
&& apt-get install --no-install-recommends -y \
24
21
postgresql-plpython3-${PG_SERVER_VERSION} \
25
- # extensions supported in PostgreSQL 12 and below
26
- # bc is used to manage PostgreSQL versions with dot like 9.6
27
- && if [ $(echo "$PG_SERVER_VERSION < 13" | /usr/bin/bc) = "1" ]; then \
28
22
# hypopg
29
- apt-get install --no-install-recommends -y \
23
+ && apt-get install --no-install-recommends -y \
30
24
postgresql-${PG_SERVER_VERSION}-hypopg \
31
- && apt-get install --no-install-recommends -y \
25
+ && apt-get install --no-install-recommends -y \
32
26
postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
33
- # pg_hint_plan extension (dots are to be skipped here, e.g., "9.6" -> "96")
34
- && export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\. //' ) \
35
- && wget --quiet -O /tmp/pg_hint_plan.zip \
36
- https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
37
- && unzip /tmp/pg_hint_plan.zip -d /tmp \
38
- && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
39
- && make && make install \
40
- # timescaledb extension
41
- && if [ $(echo "$PG_SERVER_VERSION < 11" | /usr/bin/bc) = "1" ]; then \
42
- echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
43
- $(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}' ) \
44
- 'main' > /etc/apt/sources.list.d/timescaledb.list \
45
- && wget --quiet -O - \
46
- https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
47
- && apt-get update \
48
- && apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION}; \
49
- else \
50
- echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \
51
- && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
52
- && apt-get update \
53
- && apt install -y timescaledb-2-postgresql-${PG_SERVER_VERSION}; \
54
- fi \
55
- # powa extension
56
- && apt-get install postgresql-${PG_SERVER_VERSION}-powa \
57
- # pgaudit extension
58
- && apt-get install postgresql-${PG_SERVER_VERSION}-pgaudit \
59
- # pg_auth_mon extension
60
- && git clone https://github.com/RafiaSabih/pg_auth_mon.git \
61
- && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
62
- fi \
63
- # citus extension; only Postgres 11 and 12 are supported by citus
64
- && if [ "${PG_SERVER_VERSION}" = "12" ] || [ "${PG_SERVER_VERSION}" = "11" ]; then \
27
+ # pgaudit extension
28
+ && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-pgaudit \
29
+ && if [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \
30
+ # pg_hint_plan extension (dots are to be skipped here, e.g., "9.6" -> "96")
31
+ export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\. //' ) \
32
+ && wget --quiet -O /tmp/pg_hint_plan.zip \
33
+ https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
34
+ && unzip /tmp/pg_hint_plan.zip -d /tmp \
35
+ && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
36
+ && make && make install; \
37
+ fi \
38
+ # extensions supported in PostgreSQL 12 and below
39
+ # bc is used to manage PostgreSQL versions with dot like 9.6
40
+ && if [ $(echo "$PG_SERVER_VERSION < 13" | /usr/bin/bc) = "1" ]; then \
41
+ # powa extension
42
+ apt-get install postgresql-${PG_SERVER_VERSION}-powa \
43
+ # pg_auth_mon extension
44
+ && git clone https://github.com/RafiaSabih/pg_auth_mon.git \
45
+ && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
46
+ fi \
47
+ # timescaledb extension
48
+ && if [ $(echo "$PG_SERVER_VERSION < 11" | /usr/bin/bc) = "1" ]; then \
49
+ echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
50
+ $(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}' ) \
51
+ 'main' > /etc/apt/sources.list.d/timescaledb.list \
52
+ && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
53
+ && apt-get update \
54
+ && apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION}; \
55
+ elif [ $(echo "$PG_SERVER_VERSION < 14" | /usr/bin/bc) = "1" ]; then \
56
+ echo "deb https://packagecloud.io/timescale/timescaledb/debian/ $(lsb_release -c -s) main" > /etc/apt/sources.list.d/timescaledb.list \
57
+ && wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
58
+ && apt-get update \
59
+ && apt install -y timescaledb-2-postgresql-${PG_SERVER_VERSION}; \
60
+ fi \
61
+ # citus extension; only versions Postgres 11+ are supported
62
+ && if [ "${PG_SERVER_VERSION}" = "11" ]; then \
65
63
curl -s https://install.citusdata.com/community/deb.sh | bash \
66
- && apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-${CITUS_VERSION} \
64
+ && apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-9.4 \
67
65
postgresql-${PG_SERVER_VERSION}-hll=2.14.citus-1 \
68
66
postgresql-${PG_SERVER_VERSION}-topn=2.3.0; \
69
67
fi \
68
+ && if [ $(echo "$PG_SERVER_VERSION > 11" | /usr/bin/bc) = "1" ]; then \
69
+ curl -s https://install.citusdata.com/community/deb.sh | bash \
70
+ && apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-10.2 \
71
+ postgresql-${PG_SERVER_VERSION}-hll=2.16.citus-1 \
72
+ postgresql-${PG_SERVER_VERSION}-topn=2.4.0; \
73
+ fi \
70
74
# pg_timetable extension
71
75
&& wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v2.3.0/pg_timetable_2.3.0_Linux_x86_64.deb \
72
76
&& dpkg -i pg_timetable_2.3.0_Linux_x86_64.deb \
@@ -83,14 +87,17 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
83
87
&& apt-get install postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \
84
88
# add pg_qualstats extension
85
89
&& apt-get install postgresql-${PG_SERVER_VERSION}-pg-qualstats \
86
- # pg_mon extension
87
- && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \
88
- && USE_PGXS=1 make && USE_PGXS=1 make install \
90
+ && if [ $(echo "$PG_SERVER_VERSION < 12" | /usr/bin/bc) = "1" ]; then \
91
+ # bg_mon extension
92
+ apt-get install -yq --no-install-suggests --no-install-recommends brotli \
93
+ && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon \
94
+ && USE_PGXS=1 make && USE_PGXS=1 make install && cd .. ; \
95
+ fi \
89
96
# pgextwlist extension
90
97
&& apt-get install postgresql-${PG_SERVER_VERSION}-pgextwlist \
91
98
# set_user extension
92
99
&& git clone https://github.com/pgaudit/set_user.git \
93
- && cd set_user && git checkout REL2_0_0 && make USE_PGXS=1 && make USE_PGXS=1 install \
100
+ && cd set_user && git checkout REL3_0_0 && make USE_PGXS=1 && make USE_PGXS=1 install \
94
101
# errorlogs extension
95
102
&& if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
96
103
cd /tmp && wget https://github.com/munakoiso/logerrors/archive/v2.0.tar.gz \
@@ -105,7 +112,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
105
112
make wget unzip curl libc6-dev apt-transport-https git \
106
113
postgresql-server-dev-${PG_SERVER_VERSION} pgxnclient build-essential \
107
114
libssl-dev krb5-multidev comerr-dev krb5-multidev libkrb5-dev apt-utils lsb-release \
108
- libgssrpc4 libkadm5clnt-mit11 libkadm5srv-mit11 \
115
+ libgssrpc4 \
109
116
&& apt-get clean -y autoclean \
110
117
&& rm -rf /var/lib/apt/lists/* \
111
118
# remove standard pgdata
0 commit comments