1- ARG PG_SERVER_VERSION=12
1+ ARG PG_SERVER_VERSION=14
22
33FROM postgres:${PG_SERVER_VERSION}
44LABEL maintainer="postgres.ai"
55
66ARG PG_SERVER_VERSION
7- ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-12 }
7+ ENV PG_SERVER_VERSION=${PG_SERVER_VERSION:-14 }
88
99ARG WALG_VERSION
1010ENV WALG_VERSION=${WALG_VERSION:-0.2.19}
1111
12- ENV CITUS_VERSION=9.4
13-
1412RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
1513 && apt-get update -o Acquire::CompressionTypes::Order::=gz \
1614 && apt-get install --no-install-recommends -y wget make gcc unzip sudo git \
1715 curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \
1816 build-essential libevent-dev libssl-dev krb5-multidev libkrb5-dev lsb-release apt-utils \
1917 && apt-get install --no-install-recommends -y \
2018 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 \
2320 && apt-get install --no-install-recommends -y \
2421 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 \
2822 # hypopg
29- apt-get install --no-install-recommends -y \
23+ && apt-get install --no-install-recommends -y \
3024 postgresql-${PG_SERVER_VERSION}-hypopg \
31- && apt-get install --no-install-recommends -y \
25+ && apt-get install --no-install-recommends -y \
3226 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 \
6563 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 \
6765 postgresql-${PG_SERVER_VERSION}-hll=2.14.citus-1 \
6866 postgresql-${PG_SERVER_VERSION}-topn=2.3.0; \
6967 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 \
7074 # pg_timetable extension
7175 && wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v2.3.0/pg_timetable_2.3.0_Linux_x86_64.deb \
7276 && 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 \
8387 && apt-get install postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \
8488 # add pg_qualstats extension
8589 && 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 \
8996 # pgextwlist extension
9097 && apt-get install postgresql-${PG_SERVER_VERSION}-pgextwlist \
9198 # set_user extension
9299 && 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 \
94101 # errorlogs extension
95102 && if [ $(echo "$PG_SERVER_VERSION > 9.6" | /usr/bin/bc) = "1" ]; then \
96103 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 \
105112 make wget unzip curl libc6-dev apt-transport-https git \
106113 postgresql-server-dev-${PG_SERVER_VERSION} pgxnclient build-essential \
107114 libssl-dev krb5-multidev comerr-dev krb5-multidev libkrb5-dev apt-utils lsb-release \
108- libgssrpc4 libkadm5clnt-mit11 libkadm5srv-mit11 \
115+ libgssrpc4 \
109116 && apt-get clean -y autoclean \
110117 && rm -rf /var/lib/apt/lists/* \
111118 # remove standard pgdata
0 commit comments