forked from binakot/PostgreSQL-PostGIS-TimescaleDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
114 lines (110 loc) · 3.65 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
# https://github.com/docker-library/postgres/blob/master/13/alpine/Dockerfile
FROM postgres:13.4-alpine
MAINTAINER Ivan Muratov, binakot@gmail.com
# https://postgis.net/docs/manual-3.1/postgis_installation.html
ENV POSTGIS_VERSION 3.1.4
ENV POSTGIS_SHA256 dfcbad0c6090c80bc59d3ea77d1adc4b3ade533a403761b4af6d9a44be1a6e48
RUN set -ex \
\
&& apk add --no-cache --virtual .fetch-deps \
build-base \
ca-certificates \
openssl \
git \
tar \
&& apk add --no-cache --virtual .build-deps \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
make \
automake \
autoconf \
libtool \
file \
gcc \
g++ \
perl \
clang-dev \
llvm-dev \
libxml2-dev \
\
json-c-dev \
geos-dev \
gdal-dev \
proj-dev \
protobuf-c-dev \
postgresql-dev \
&& apk add --no-cache --virtual .postgis-rundeps \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
json-c \
geos \
gdal \
proj \
protobuf-c \
\
&& wget -O postgis.tar.gz "https://github.com/postgis/postgis/archive/$POSTGIS_VERSION.tar.gz" \
&& echo "$POSTGIS_SHA256 *postgis.tar.gz" | sha256sum -c - \
&& mkdir -p /usr/src/postgis \
&& tar \
--extract \
--file postgis.tar.gz \
--directory /usr/src/postgis \
--strip-components 1 \
&& rm postgis.tar.gz \
\
&& cd /usr/src/postgis \
&& ./autogen.sh \
&& ./configure \
&& make -s \
&& make -s install \
&& cd / \
&& rm -rf /usr/src/postgis \
&& apk del .fetch-deps .build-deps
# https://docs.timescale.com/timescaledb/latest/how-to-guides/install-timescaledb/self-hosted/ubuntu/installation-source
ENV TIMESCALEDB_VERSION 2.4.2
ENV TIMESCALEDB_SHA256 b206a376251259eb745eee819e7a853b3fbab9dc8443303714484a0fef89a2a4
RUN set -ex \
&& apk add --no-cache --virtual .fetch-deps \
build-base \
ca-certificates \
git \
tar \
&& apk add --no-cache --virtual .build-deps \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository http://dl-cdn.alpinelinux.org/alpine/edge/testing \
make \
cmake \
gcc \
clang \
clang-dev \
llvm-dev \
dpkg \
dpkg-dev \
util-linux-dev \
libc-dev \
coreutils \
&& apk add --no-cache --virtual .timescaledb-rundeps \
openssl \
openssl-dev \
\
&& wget -O timescaledb.tar.gz "https://github.com/timescale/timescaledb/archive/$TIMESCALEDB_VERSION.tar.gz" \
&& echo "$TIMESCALEDB_SHA256 *timescaledb.tar.gz" | sha256sum -c - \
&& mkdir -p /usr/src/timescaledb \
&& tar \
--extract \
--file timescaledb.tar.gz \
--directory /usr/src/timescaledb \
--strip-components 1 \
&& rm timescaledb.tar.gz \
\
&& cd /usr/src/timescaledb \
&& ./bootstrap -DPROJECT_INSTALL_METHOD="docker" -DREGRESS_CHECKS=OFF \
&& cd ./build && make install \
\
&& cd / \
&& rm -rf /usr/src/timescaledb \
&& apk del .fetch-deps .build-deps \
&& sed -r -i "s/[#]*\s*(shared_preload_libraries)\s*=\s*'(.*)'/\1 = 'timescaledb,\2'/;s/,'/'/" /usr/local/share/postgresql/postgresql.conf.sample
COPY ./init-postgis.sh /docker-entrypoint-initdb.d/1.postgis.sh
COPY ./init-timescaledb.sh /docker-entrypoint-initdb.d/2.timescaledb.sh
COPY ./init-postgres.sh /docker-entrypoint-initdb.d/3.postgres.sh