forked from supabase/postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
201 lines (182 loc) · 6 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
FROM postgres@sha256:06277995d7028f4455e56f21864146ee2425c83308dc96283c7a96e6881cc826
# install pgcron
RUN apt-get update \
&& apt-get install postgresql-12-cron -y
# install postgis
ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.0.0+dfsg-2~exp1.pgdg100+1
RUN apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
&& apt-get install -y --no-install-recommends \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
&& rm -rf /var/lib/apt/lists/* /var/tmp/*
# install pgtap
ENV PGTAP_VERSION=v1.1.0
RUN pgtapDependencies="git \
ca-certificates \
build-essential" \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${pgtapDependencies} \
&& cd /tmp \
&& git clone git://github.com/theory/pgtap.git \
&& cd pgtap \
&& git checkout tags/$PGTAP_VERSION \
&& make install \
&& apt-get clean \
&& apt-get remove -y ${pgtapDependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/pgtap /var/lib/apt/lists/* /var/tmp/*
# install pgAudit
ENV PGAUDIT_VERSION=1.4.0
RUN pgAuditDependencies="git \
ca-certificates \
build-essential \
postgresql-server-dev-$PG_MAJOR \
libssl-dev \
libkrb5-dev" \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${pgAuditDependencies} \
&& cd /tmp \
&& git clone https://github.com/pgaudit/pgaudit.git \
&& cd pgaudit \
&& git checkout ${PGAUDIT_VERSION} \
&& make check USE_PGXS=1 \
&& make install USE_PGXS=1 \
&& apt-get clean \
&& apt-get remove -y ${pgAuditDependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/pgaudit /var/lib/apt/lists/* /var/tmp/*
# install pgjwt
RUN pgjwtDependencies="git \
ca-certificates \
build-essential" \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${pgjwtDependencies} \
&& cd /tmp \
&& git clone https://github.com/michelp/pgjwt.git \
&& cd pgjwt \
&& git checkout master \
&& make install \
&& apt-get clean \
&& apt-get remove -y ${pgtapDependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/pgjwt /var/lib/apt/lists/* /var/tmp/*
# install pgsql-http
ENV PGSQL_HTTP_VERSION=v1.3.1
RUN pgsqlHttpDependencies="git \
ca-certificates \
build-essential \
postgresql-server-dev-$PG_MAJOR" \
&& pgsqlHttpRuntimeDependencies="libcurl4-gnutls-dev" \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${pgsqlHttpDependencies} ${pgsqlHttpRuntimeDependencies} \
&& cd /tmp \
&& git clone https://github.com/pramsey/pgsql-http.git \
&& cd pgsql-http \
&& git checkout ${PGSQL_HTTP_VERSION} \
&& make \
&& make install \
&& apt-get clean \
&& apt-get remove -y ${pgsqlHttpDependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/pgsql-http /var/lib/apt/lists/* /var/tmp/*
# install plpgsql_check
ENV PLPGSQL_CHECK_VERSION=v1.11.3
RUN plpgsqlCheckDependencies="git \
ca-certificates \
build-essential \
postgresql-server-dev-$PG_MAJOR" \
&& plpgsqlCheckRuntimeDependencies="libicu-dev" \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${plpgsqlCheckDependencies} ${plpgsqlCheckRuntimeDependencies} \
&& cd /tmp \
&& git clone https://github.com/okbob/plpgsql_check.git \
&& cd plpgsql_check \
&& git checkout ${PLPGSQL_CHECK_VERSION} \
&& make clean \
&& make install \
&& apt-get clean \
&& apt-get remove -y ${pgsqlHttpDependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/plpgsql_check /var/lib/apt/lists/* /var/tmp/*
# install pg-safeupdate
ENV PGSAFEUPDATE_VERSION=1.3
RUN pgSafeUpdateDependencies="pgxnclient \
postgresql-server-dev-12" \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${pgSafeUpdateDependencies} \
&& cd /tmp \
&& git clone https://github.com/eradman/pg-safeupdate.git \
&& cd pg-safeupdate \
&& git checkout ${PGSAFEUPDATE_VERSION} \
&& make \
&& make install \
&& apt-get clean \
&& apt-get remove -y ${pgSafeUpdateDependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/pg-safeupdate /var/lib/apt/lists/* /var/tmp/*
# install plv8
ENV PLV8_VERSION=r3.0alpha
RUN plv8Dependencies="build-essential \
ca-certificates \
curl \
git-core \
python \
gpp \
cpp \
pkg-config \
apt-transport-https \
cmake \
libc++-dev \
libc++abi-dev \
postgresql-server-dev-$PG_MAJOR" \
&& plv8RuntimeDependencies="libc++1 \
libtinfo5 \
libc++abi1" \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${plv8Dependencies} ${plv8RuntimeDependencies} \
&& mkdir -p /tmp/build \
&& cd /tmp/build \
&& git clone https://github.com/plv8/plv8.git \
&& cd plv8 \
&& git checkout ${PLV8_VERSION} \
&& make static \
&& make install \
&& rm -rf /root/.vpython_cipd_cache /root/.vpython-root \
&& apt-get clean \
&& apt-get remove -y ${plv8Dependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/build /var/lib/apt/lists/* /var/tmp/*
# install pljava
ENV PLJAVA_VERSION=V1_6_0
RUN pljavaDependencies="git \
ca-certificates \
g++ \
maven \
postgresql-server-dev-$PG_MAJOR \
libpq-dev \
libecpg-dev \
libkrb5-dev \
default-jdk \
libssl-dev" \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${pljavaDependencies} \
&& cd /tmp \
&& git clone https://github.com/tada/pljava.git \
&& cd pljava \
&& git checkout ${PLJAVA_VERSION} \
&& mvn clean install \
&& java -jar pljava-packaging/target/pljava-pg12.jar \
&& apt-get clean \
&& apt-get remove -y ${pljavaDependencies} \
&& apt-get autoremove -y \
&& rm -rf ~/.m2 /tmp/pljava /var/lib/apt/lists/* /var/tmp/*
RUN apt-get update \
&& apt-get install -y --no-install-recommends default-jdk-headless \
&& rm -rf /var/lib/apt/lists/* /var/tmp/*
ENV LANGUAGE=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
RUN mkdir -p /docker-entrypoint-initdb.d
ADD ./mnt /docker-entrypoint-initdb.d/