kopia lustrzana https://github.com/kartoza/docker-postgis
add h3 extension
rodzic
9f02f21202
commit
84c0f22ef7
53
Dockerfile
53
Dockerfile
|
@ -22,16 +22,16 @@ RUN set -eux \
|
||||||
&& export DEBIAN_FRONTEND=noninteractive \
|
&& export DEBIAN_FRONTEND=noninteractive \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get -y --no-install-recommends install \
|
&& apt-get -y --no-install-recommends install \
|
||||||
locales gnupg2 wget ca-certificates rpl pwgen software-properties-common iputils-ping \
|
locales gnupg2 wget ca-certificates rpl pwgen software-properties-common iputils-ping \
|
||||||
apt-transport-https curl gettext pgxnclient cmake && \
|
apt-transport-https curl gettext pgxnclient cmake && \
|
||||||
apt-get -y install build-essential autoconf libxml2-dev zlib1g-dev netcat-openbsd gdal-bin \
|
apt-get -y install build-essential autoconf libxml2-dev zlib1g-dev netcat-openbsd gdal-bin \
|
||||||
figlet toilet gosu; \
|
figlet toilet gosu; \
|
||||||
# verify that the binary works
|
# verify that the binary works
|
||||||
gosu nobody true && \
|
gosu nobody true && \
|
||||||
dpkg-divert --local --rename --add /sbin/initctl
|
dpkg-divert --local --rename --add /sbin/initctl
|
||||||
|
|
||||||
|
|
||||||
# Generating locales takes a long time. Utilize caching by runnig it by itself
|
# Generating locales takes a long time. Utilize caching by running it by itself
|
||||||
# early in the build process.
|
# early in the build process.
|
||||||
|
|
||||||
# Generate all locale only on deployment mode build
|
# Generate all locale only on deployment mode build
|
||||||
|
@ -46,20 +46,20 @@ ENV LANG=en_US.UTF-8 \
|
||||||
COPY ./base_build/scripts/locale.gen /etc/all.locale.gen
|
COPY ./base_build/scripts/locale.gen /etc/all.locale.gen
|
||||||
COPY ./base_build/scripts/locale-filter.sh /etc/locale-filter.sh
|
COPY ./base_build/scripts/locale-filter.sh /etc/locale-filter.sh
|
||||||
RUN if [ -z "${GENERATE_ALL_LOCALE}" ] || [ $GENERATE_ALL_LOCALE -eq 0 ]; \
|
RUN if [ -z "${GENERATE_ALL_LOCALE}" ] || [ $GENERATE_ALL_LOCALE -eq 0 ]; \
|
||||||
then \
|
then \
|
||||||
cat /etc/all.locale.gen | grep "${LANG}" > /etc/locale.gen; \
|
cat /etc/all.locale.gen | grep "${LANG}" > /etc/locale.gen; \
|
||||||
/bin/bash /etc/locale-filter.sh; \
|
/bin/bash /etc/locale-filter.sh; \
|
||||||
else \
|
else \
|
||||||
cp -f /etc/all.locale.gen /etc/locale.gen; \
|
cp -f /etc/all.locale.gen /etc/locale.gen; \
|
||||||
fi; \
|
fi; \
|
||||||
set -eux \
|
set -eux \
|
||||||
&& /usr/sbin/locale-gen
|
&& /usr/sbin/locale-gen
|
||||||
|
|
||||||
RUN update-locale ${LANG}
|
RUN update-locale ${LANG}
|
||||||
|
|
||||||
|
|
||||||
# Cleanup resources
|
# Cleanup resources
|
||||||
RUN apt-get -y --purge autoremove \
|
RUN apt-get -y --purge autoremove \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
@ -80,11 +80,10 @@ ARG TIMESCALE_VERSION=2
|
||||||
ARG BUILD_TIMESCALE=true
|
ARG BUILD_TIMESCALE=true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RUN set -eux \
|
RUN set -eux \
|
||||||
&& export DEBIAN_FRONTEND=noninteractive \
|
&& export DEBIAN_FRONTEND=noninteractive \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& wget -O- https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sh -c 'cat > /usr/share/keyrings/postgresql.gpg' > /dev/null \
|
&& wget -O- https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | sh -c 'cat > /usr/share/keyrings/postgresql.gpg' > /dev/null \
|
||||||
&& echo deb [signed-by=/usr/share/keyrings/postgresql.gpg] https://apt.postgresql.org/pub/repos/apt/ ${IMAGE_VERSION}-pgdg main | tee /etc/apt/sources.list.d/pgdg.list 2>/dev/null \
|
&& echo deb [signed-by=/usr/share/keyrings/postgresql.gpg] https://apt.postgresql.org/pub/repos/apt/ ${IMAGE_VERSION}-pgdg main | tee /etc/apt/sources.list.d/pgdg.list 2>/dev/null \
|
||||||
&& apt-get -y --purge autoremove \
|
&& apt-get -y --purge autoremove \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
|
@ -94,34 +93,36 @@ RUN set -eux \
|
||||||
|
|
||||||
#-------------Application Specific Stuff ----------------------------------------------------
|
#-------------Application Specific Stuff ----------------------------------------------------
|
||||||
|
|
||||||
# We add postgis as well to prevent build errors (that we dont see on local builds)
|
# We add postgis as well to prevent build errors (that we don't see on local builds)
|
||||||
# on docker hub e.g.
|
# on docker hub e.g.
|
||||||
# The following packages have unmet dependencies:
|
# The following packages have unmet dependencies:
|
||||||
|
|
||||||
RUN set -eux \
|
RUN set -eux \
|
||||||
&& export DEBIAN_FRONTEND=noninteractive \
|
&& export DEBIAN_FRONTEND=noninteractive \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get -y --no-install-recommends install postgresql-client-${POSTGRES_MAJOR_VERSION} \
|
&& apt-get -y --no-install-recommends install postgresql-client-${POSTGRES_MAJOR_VERSION} \
|
||||||
postgresql-common postgresql-${POSTGRES_MAJOR_VERSION} \
|
postgresql-common postgresql-${POSTGRES_MAJOR_VERSION} \
|
||||||
postgresql-${POSTGRES_MAJOR_VERSION}-postgis-${POSTGIS_MAJOR_VERSION} \
|
postgresql-${POSTGRES_MAJOR_VERSION}-postgis-${POSTGIS_MAJOR_VERSION} \
|
||||||
postgresql-${POSTGRES_MAJOR_VERSION}-ogr-fdw \
|
postgresql-${POSTGRES_MAJOR_VERSION}-ogr-fdw \
|
||||||
postgresql-${POSTGRES_MAJOR_VERSION}-postgis-${POSTGIS_MAJOR_VERSION}-scripts \
|
postgresql-${POSTGRES_MAJOR_VERSION}-postgis-${POSTGIS_MAJOR_VERSION}-scripts \
|
||||||
postgresql-plpython3-${POSTGRES_MAJOR_VERSION} postgresql-${POSTGRES_MAJOR_VERSION}-pgrouting \
|
postgresql-plpython3-${POSTGRES_MAJOR_VERSION} postgresql-${POSTGRES_MAJOR_VERSION}-pgrouting \
|
||||||
postgresql-server-dev-${POSTGRES_MAJOR_VERSION} postgresql-${POSTGRES_MAJOR_VERSION}-cron \
|
postgresql-server-dev-${POSTGRES_MAJOR_VERSION} postgresql-${POSTGRES_MAJOR_VERSION}-cron \
|
||||||
postgresql-${POSTGRES_MAJOR_VERSION}-mysql-fdw && \
|
postgresql-${POSTGRES_MAJOR_VERSION}-mysql-fdw
|
||||||
pgxn install h3
|
|
||||||
|
# Install H3 extension using pgxnclient
|
||||||
|
RUN pgxn install h3
|
||||||
|
|
||||||
# TODO a case insensitive match would be more robust
|
# TODO a case insensitive match would be more robust
|
||||||
RUN if [ "${BUILD_TIMESCALE}" = "true" ]; then \
|
RUN if [ "${BUILD_TIMESCALE}" = "true" ]; then \
|
||||||
export DEBIAN_FRONTEND=noninteractive && \
|
export DEBIAN_FRONTEND=noninteractive && \
|
||||||
sh -c "echo \"deb [signed-by=/usr/share/keyrings/timescale.keyring] https://packagecloud.io/timescale/timescaledb/debian/ ${IMAGE_VERSION} main\" > /etc/apt/sources.list.d/timescaledb.list" && \
|
sh -c "echo \"deb [signed-by=/usr/share/keyrings/timescale.keyring] https://packagecloud.io/timescale/timescaledb/debian/ ${IMAGE_VERSION} main\" > /etc/apt/sources.list.d/timescaledb.list" && \
|
||||||
wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | gpg --dearmor -o /usr/share/keyrings/timescale.keyring && \
|
wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | gpg --dearmor -o /usr/share/keyrings/timescale.keyring && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get -y --no-install-recommends install timescaledb-${TIMESCALE_VERSION}-postgresql-${POSTGRES_MAJOR_VERSION} timescaledb-tools;\
|
apt-get -y --no-install-recommends install timescaledb-${TIMESCALE_VERSION}-postgresql-${POSTGRES_MAJOR_VERSION} timescaledb-tools; \
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
RUN echo $POSTGRES_MAJOR_VERSION >/tmp/pg_version.txt && echo $POSTGIS_MAJOR_VERSION >/tmp/pg_major_version.txt && \
|
RUN echo $POSTGRES_MAJOR_VERSION >/tmp/pg_version.txt && echo $POSTGIS_MAJOR_VERSION >/tmp/pg_major_version.txt && \
|
||||||
echo $POSTGIS_MINOR_RELEASE >/tmp/pg_minor_version.txt
|
echo $POSTGIS_MINOR_RELEASE >/tmp/pg_minor_version.txt
|
||||||
ENV \
|
ENV \
|
||||||
PATH="$PATH:/usr/lib/postgresql/${POSTGRES_MAJOR_VERSION}/bin"
|
PATH="$PATH:/usr/lib/postgresql/${POSTGRES_MAJOR_VERSION}/bin"
|
||||||
# Compile pointcloud extension
|
# Compile pointcloud extension
|
||||||
|
@ -132,7 +133,7 @@ cd pointcloud-master && \
|
||||||
cd .. && rm -Rf pointcloud-master
|
cd .. && rm -Rf pointcloud-master
|
||||||
|
|
||||||
# Cleanup resources
|
# Cleanup resources
|
||||||
RUN apt-get -y --purge autoremove \
|
RUN apt-get -y --purge autoremove \
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
@ -147,7 +148,7 @@ RUN chmod +x *.sh
|
||||||
# Run any additional tasks here that are too tedious to put in
|
# Run any additional tasks here that are too tedious to put in
|
||||||
# this dockerfile directly.
|
# this dockerfile directly.
|
||||||
RUN set -eux \
|
RUN set -eux \
|
||||||
&& /scripts/setup.sh;rm /scripts/.pass_*
|
&& /scripts/setup.sh; rm /scripts/.pass_*
|
||||||
RUN echo 'figlet -t "Kartoza Docker PostGIS"' >> ~/.bashrc
|
RUN echo 'figlet -t "Kartoza Docker PostGIS"' >> ~/.bashrc
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue