1
- ARG PG_SERVER_VERSION=11
2
- ARG CITUS=9.4
1
+ ARG PG_SERVER_VERSION=12
3
2
4
3
FROM postgres:${PG_SERVER_VERSION}
5
4
MAINTAINER postgres.ai
@@ -15,82 +14,53 @@ RUN apt-get update \
15
14
&& apt-get install --no-install-recommends -y postgresql-server-dev-${PG_SERVER_VERSION} \
16
15
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-repack \
17
16
&& apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-hypopg \
18
- && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym
19
-
20
- RUN if [ "${PG_SERVER_VERSION}" = "12" ]; then \
21
- # pg_hint_plan for Postgres 12 does not supported yet, use master: https://github.com/ossc-db/pg_hint_plan/issues/37
22
- wget --quiet -O /tmp/pg_hint_plan.zip https://github.com/ossc-db/pg_hint_plan/archive/master.zip \
23
- && unzip /tmp/pg_hint_plan.zip -d /tmp && cd /tmp/pg_hint_plan-master \
24
- && make && make install || echo "[WARNING] pg_hint_plan extension not found" ; \
25
- else \
26
- # convert versions with dot "9.6" to "96"
27
- export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\. //' ) \
28
- && wget --quiet -O /tmp/pg_hint_plan.zip https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
29
- && unzip /tmp/pg_hint_plan.zip -d /tmp && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
30
- && make && make install || echo "[WARNING] pg_hint_plan extension not found" ; \
31
- fi
32
-
17
+ && apt-get install --no-install-recommends -y postgresql-${PG_SERVER_VERSION}-hypopg-dbgsym \
18
+ # convert versions with dot "9.6" to "96"
19
+ && export PG_PLAN_HINT_VERSION=$(echo $PG_SERVER_VERSION | sed 's/\. //' ) \
20
+ && wget --quiet -O /tmp/pg_hint_plan.zip https://github.com/ossc-db/pg_hint_plan/archive/PG${PG_PLAN_HINT_VERSION}.zip \
21
+ && unzip /tmp/pg_hint_plan.zip -d /tmp && cd /tmp/pg_hint_plan-PG${PG_PLAN_HINT_VERSION} \
22
+ && make && make install || echo "[WARNING] pg_hint_plan extension not found" \
33
23
# add timescaledb extension
34
- RUN echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' `env -i bash -c '. /etc/os-release; echo $VERSION_CODENAME' ` 'main' > /etc/apt/sources.list.d/timescaledb.list \
24
+ && echo 'deb https://packagecloud.io/timescale/timescaledb/debian/' `env -i bash -c '. /etc/os-release; echo $VERSION_CODENAME' ` 'main' > /etc/apt/sources.list.d/timescaledb.list \
35
25
&& wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add - \
36
26
&& apt-get update \
37
- && apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION}
38
-
39
-
27
+ && apt-get install -y timescaledb-postgresql-${PG_SERVER_VERSION} \
40
28
# add citus extension
41
- RUN if [ "${PG_SERVER_VERSION}" = "12" ] || [ "${PG_SERVER_VERSION}" = "11" ]; then \
29
+ && if [ "${PG_SERVER_VERSION}" = "12" ] || [ "${PG_SERVER_VERSION}" = "11" ]; then \
42
30
# only 11 and 12 versions are supported by citus
43
31
curl -s https://install.citusdata.com/community/deb.sh | bash \
44
32
&& apt-get install -y postgresql-${PG_SERVER_VERSION}-citus-${CITUS_VERSION} \
45
33
postgresql-${PG_SERVER_VERSION}-hll=2.14.citus-1 \
46
34
postgresql-${PG_SERVER_VERSION}-topn=2.3.0; \
47
- fi
35
+ fi \
48
36
# add powa extension
49
- RUN apt-get install postgresql-${PG_SERVER_VERSION}-powa
50
-
37
+ && apt-get install postgresql-${PG_SERVER_VERSION}-powa \
51
38
# add pg_timetable extension
52
- RUN wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v2.3.0/pg_timetable_2.3.0_Linux_x86_64.deb \
53
- && dpkg -i pg_timetable_2.3.0_Linux_x86_64.deb \
54
- && rm -rf pg_timetable_2.3.0_Linux_x86_64.deb
55
-
39
+ && wget https://github.com/cybertec-postgresql/pg_timetable/releases/download/v2.3.0/pg_timetable_2.3.0_Linux_x86_64.deb && dpkg -i pg_timetable_2.3.0_Linux_x86_64.deb && rm -rf pg_timetable_2.3.0_Linux_x86_64.deb \
56
40
# add pg_show_plans extension
57
- RUN git clone https://github.com/cybertec-postgresql/pg_show_plans.git
58
- WORKDIR /pg_show_plans
59
- RUN export USE_PGXS=1 && make && make install
60
- WORKDIR /
61
-
41
+ && git clone https://github.com/cybertec-postgresql/pg_show_plans.git && cd pg_show_plans && export USE_PGXS=1 && make && make install && cd .. && rm -rf pg_show_plans \
62
42
# add pg_cron extension
63
- RUN apt-get install -y postgresql-${PG_SERVER_VERSION}-cron
64
-
43
+ && apt-get install -y postgresql-${PG_SERVER_VERSION}-cron \
65
44
# add postgresql_anonymizer extension
66
- RUN pgxn install ddlx && pgxn install postgresql_anonymizer
67
-
68
-
45
+ && pgxn install ddlx && pgxn install postgresql_anonymizer \
69
46
# add pg_stat_kcache extension
70
- RUN apt-get install postgresql-${PG_SERVER_VERSION}-pg-stat-kcache
71
-
47
+ && apt-get install postgresql-${PG_SERVER_VERSION}-pg-stat-kcache \
72
48
# add pg_qualstats extension
73
- RUN apt-get install postgresql-${PG_SERVER_VERSION}-pg-qualstats
74
-
49
+ &&apt-get install postgresql-${PG_SERVER_VERSION}-pg-qualstats \
75
50
# add pg_mon extension
76
- RUN git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon && USE_PGXS=1 make && USE_PGXS=1 make install
77
-
51
+ && git clone https://github.com/CyberDem0n/bg_mon.git && cd bg_mon && USE_PGXS=1 make && USE_PGXS=1 make install \
78
52
# add pgextwlist extension
79
- RUN apt-get install postgresql-${PG_SERVER_VERSION}-pgextwlist
80
-
53
+ && apt-get install postgresql-${PG_SERVER_VERSION}-pgextwlist \
81
54
# add pg_auth_mon extension
82
- RUN git clone https://github.com/RafiaSabih/pg_auth_mon.git && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install
83
-
55
+ && git clone https://github.com/RafiaSabih/pg_auth_mon.git && cd pg_auth_mon && USE_PGXS=1 make && USE_PGXS=1 make install \
84
56
# add set_user extension
85
- RUN git clone https://github.com/pgaudit/set_user.git && cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install
86
-
57
+ && git clone https://github.com/pgaudit/set_user.git && cd set_user && make USE_PGXS=1 && make USE_PGXS=1 install \
87
58
# Reduce images size.
88
- RUN rm -rf /tmp/* \
59
+ && rm -rf /tmp/* \
89
60
&& apt-get purge -y --auto-remove gcc make wget unzip curl libc6-dev apt-transport-https git postgresql-server-dev-${PG_SERVER_VERSION} pgxnclient build-essential libevent-dev \
90
- libssl-dev krb5-multidev comerr-dev krb5-multidev libgssrpc4 libkadm5clnt-mit11 libkadm5srv-mit11 \
61
+ libssl-dev krb5-multidev comerr-dev krb5-multidev libgssrpc4 libkadm5clnt-mit11 libkadm5srv-mit11 \
91
62
&& apt-get clean -y autoclean \
92
63
&& rm -rf /var/lib/apt/lists/* \
93
- && rm -rf /pg_show_plans \
94
64
# We don't want to use standard pgdata.
95
65
&& rm -rf /var/lib/postgresql/${PG_SERVER_VERSION}/
96
66
0 commit comments