-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (35 loc) · 1.43 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
FROM postgres:9.5
MAINTAINER unoexperto <[email protected]>
ENV POSTGIS_MAJOR 2.3
ENV POSTGIS_VERSION 2.3.0+dfsg-2.pgdg80+1
ENV PLV8_VERSION=v1.5.3 \
PLV8_SHASUM="fac8052c926c9ece74f655500caeca50552c0c4b4c7081c0c7946e06ed114d1c v1.5.3.tar.gz"
RUN buildDependencies="build-essential \
ca-certificates \
curl \
git-core \
postgresql-server-dev-$PG_MAJOR" \
&& apt-get update \
&& apt-get install -y --no-install-recommends ${buildDependencies} \
&& mkdir -p /tmp/build \
&& curl -o /tmp/build/${PLV8_VERSION}.tar.gz -SL "https://github.com/plv8/plv8/archive/$PLV8_VERSION.tar.gz" \
&& cd /tmp/build \
&& echo ${PLV8_SHASUM} | sha256sum -c \
&& tar -xzf /tmp/build/${PLV8_VERSION}.tar.gz -C /tmp/build/ \
&& cd /tmp/build/plv8-${PLV8_VERSION#?} \
&& make static \
&& make install \
&& strip /usr/lib/postgresql/${PG_MAJOR}/lib/plv8.so \
&& cd / \
&& apt-get clean \
&& apt-get remove -y ${buildDependencies} \
&& apt-get autoremove -y \
&& rm -rf /tmp/build /var/lib/apt/lists/*
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \
postgis=$POSTGIS_VERSION \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /docker-entrypoint-initdb.d
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/postgis.sh