forked from postgis/docker-postgis
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.debian.template
38 lines (33 loc) · 1.53 KB
/
Dockerfile.debian.template
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
FROM postgres:{{ .[env.variant].PG_DOCKER }}-{{ env.variant }}
LABEL maintainer="PostGIS Project - https://postgis.net" \
org.opencontainers.image.description="PostGIS {{ .[env.variant].POSTGIS_VERSION }} spatial database extension with PostgreSQL {{ .[env.variant].PG_MAJOR }} {{ env.variant }}" \
org.opencontainers.image.source="https://github.com/postgis/docker-postgis"
ENV POSTGIS_MAJOR {{ .[env.variant].POSTGIS_MAJOR }}
ENV POSTGIS_VERSION {{ .[env.variant].POSTGIS_VERSION }}
RUN set -eux \
&& apt-get update \
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
&& apt-get install -y --no-install-recommends \
# ca-certificates: for accessing remote raster files;
# fix: https://github.com/postgis/docker-postgis/issues/307
ca-certificates \
\
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts \
{{ if env.version | startswith("11") then ( -}}
# \
{{ ) else ( -}}
postgis \
{{ ) end -}}
&& rm -rf /var/lib/apt/lists/*
# multiple LLVM existance is not allowed.
RUN set -eux \
&& dpkg -l | grep llvm \
&& llvm_count=$(dpkg -l | grep llvm | wc -l) \
&& if [ "$llvm_count" -ne 1 ]; then \
echo "More than one llvm package or none at all found. Stopping."; \
exit 1; \
fi
RUN mkdir -p /docker-entrypoint-initdb.d
COPY ./initdb-postgis.sh /docker-entrypoint-initdb.d/10_postgis.sh
COPY ./update-postgis.sh /usr/local/bin