@@ -11,40 +11,48 @@ ENV CITUS_VERSION=9.4
11
11
RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
12
12
&& apt-get update -o Acquire::CompressionTypes::Order::=gz \
13
13
&& apt-get install --no-install-recommends -y wget make gcc unzip sudo git \
14
- curl libc6-dev apt-transport-https ca-certificates pgxnclient \
14
+ curl libc6-dev apt-transport-https ca-certificates pgxnclient bc \
15
15
build-essential libevent-dev libssl-dev krb5-multidev \
16
16
&& apt-get install --no-install-recommends -y \
17
17
postgresql-server-dev-${PG_SERVER_VERSION} \
18
18
&& apt-get install --no-install-recommends -y \
19
19
postgresql-${PG_SERVER_VERSION}-repack \
20
- && apt-get install --no-install-recommends -y \
21
- postgresql-${PG_SERVER_VERSION}-hypopg \
22
- && apt-get install --no-install-recommends -y \
23
- postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
24
- # pg_hint_plan extension (dots are to be skipped here, e.g., "9.6" -> "96")
25
- && export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\. //' ) \
26
- && wget --quiet -O /tmp/pg_hint_plan.zip \
20
+ # extensions supported in PostgreSQL 12 and below
21
+ # bc is used to manage PostgreSQL versions with dot like 9.6
22
+ && if [ $(echo "$PG_SERVER_VERSION < 13" | /usr/bin/bc) = "1" ]; then \
23
+ # hypopg
24
+ apt-get install --no-install-recommends -y \
25
+ postgresql-${PG_SERVER_VERSION}-hypopg \
26
+ && apt-get install --no-install-recommends -y \
27
+ postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
28
+ # pg_hint_plan extension (dots are to be skipped here, e.g., "9.6" -> "96")
29
+ && export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\. //' ) \
30
+ && wget --quiet -O /tmp/pg_hint_plan.zip \
27
31
https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
28
- && unzip /tmp/pg_hint_plan.zip -d /tmp \
32
+ && unzip /tmp/pg_hint_plan.zip -d /tmp \
29
33
&& cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
30
- && make && make install \
31
- # timescaledb extension
32
- && echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
33
- $(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}' ) \
34
- 'main' > /etc/apt/sources.list.d/timescaledb.list \
35
- && wget --quiet -O - \
34
+ && make && make install \
35
+ # timescaledb extension
36
+ && echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' \
37
+ $(env -i bash -c '. /etc/os-release; echo ${VERSION_CODENAME}' ) \
38
+ 'main' > /etc/apt/sources.list.d/timescaledb.list \
39
+ && wget --quiet -O - \
36
40
https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
37
- && apt-get update \
38
- && apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION} \
41
+ && apt-get update \
42
+ && apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION} \
43
+ # powa extension
44
+ && apt-get install postgresql-${PG_SERVER_VERSION}-powa \
45
+ # pg_auth_mon extension
46
+ && git clone https://github.com/RafiaSabih/pg_auth_mon.git \
47
+ && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install; \
48
+ fi \
39
49
# citus extension; only Postgres 11 and 12 are supported by citus
40
50
&& if [ "${PG_SERVER_VERSION}" = "12" ] || [ "${PG_SERVER_VERSION}" = "11" ]; then \
41
51
curl -s https://install.citusdata.com/community/deb.sh | bash \
42
52
&& apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-${CITUS_VERSION} \
43
53
postgresql-${PG_SERVER_VERSION}-hll=2.14.citus-1 \
44
54
postgresql-${PG_SERVER_VERSION}-topn=2.3.0; \
45
55
fi \
46
- # powa extension
47
- && apt-get install postgresql-${PG_SERVER_VERSION}-powa \
48
56
# pg_timetable extension
49
57
&& wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v2.3.0/pg_timetable_2.3.0_Linux_x86_64.deb \
50
58
&& dpkg -i pg_timetable_2.3.0_Linux_x86_64.deb \
@@ -66,9 +74,6 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/partial \
66
74
&& USE_PGXS=1 make && USE_PGXS=1 make install \
67
75
# pgextwlist extension
68
76
&& apt-get install postgresql-${PG_SERVER_VERSION}-pgextwlist \
69
- # pg_auth_mon extension
70
- && git clone https://github.com/RafiaSabih/pg_auth_mon.git \
71
- && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install \
72
77
# set_user extension
73
78
&& git clone https://github.com/pgaudit/set_user.git \
74
79
&& cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install \
0 commit comments