-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdockerfile
71 lines (67 loc) · 1.66 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
FROM alpine:3.10
ENV PGDATA=/var/lib/postgresql/data
RUN set -x \
&& install -o postgres -g postgres -m 755 -d $PGDATA /var/lib/postgresql/conf \
&& cd /tmp \
&& wget -qO- https://github.com/postgres/postgres/archive/REL_11_4.tar.gz | tar xz \
# && wget -qO- https://github.com/postgres/postgres/archive/REL_12_1.tar.gz | tar xz \
# && wget -qO- https://github.com/postgres/postgres/archive/REL_13_BETA3.tar.gz | tar xz \
\
&& apk add --no-cache --virtual .build-deps \
--repositories-file /dev/null \
--repository https://mirror.ps.kz/alpine/v3.10/main \
build-base \
linux-headers \
bison \
flex \
libxml2-dev \
libxslt-dev \
icu-dev \
openssl-dev \
autoconf \
automake \
libtool \
clang-dev \
llvm8-dev \
\
&& cd /tmp/postgres-* \
&& ./configure \
--prefix=/usr/local \
--without-readline \
--with-libxml \
--with-libxslt \
--with-icu \
--with-openssl \
--with-llvm \
&& make \
&& make install \
&& apk del .build-deps \
&& rm -r /tmp/* \
\
&& apk add --no-cache --virtual .pg-runtime-deps \
--repositories-file /dev/null \
--repository https://mirror.ps.kz/alpine/v3.10/main \
libxml2 \
libxslt \
icu \
openssl \
llvm8
RUN set -x \
&& apk add --no-cache --virtual .build-deps \
--repositories-file /dev/null \
--repository https://mirror.ps.kz/alpine/v3.10/main \
build-base \
clang \
llvm8-dev \
\
&& su postgres sh -c initdb \
&& echo wal_level=logical >> $PGDATA/postgresql.conf
CMD set -x \
&& cp -r /src /tmp/pg_json_decoding \
&& cd /tmp/pg_json_decoding \
&& make \
&& make install \
&& su postgres sh -c \
'pg_ctl -w start \
&& psql -v ON_ERROR_STOP=1 -f test.sql \
&& pg_ctl -w stop'