Docker locale tz (#711)

* update locales and timezone

* tabs to spaces

* fix ref
This commit is contained in:
Tom Kralidis
2021-06-17 10:51:23 -04:00
committed by GitHub
parent 05c18e14ee
commit 61e5ab68af
+29 -26
View File
@@ -59,16 +59,17 @@ LABEL maintainer="Just van den Broecke <justb4@gmail.com>"
# add "--build-arg BUILD_DEV_IMAGE=true" to Docker build command when building with test/doc tools
# ARGS
ARG TIMEZONE="Europe/London"
ARG LOCALE="en_US.UTF-8"
ARG TZ="Etc/UTC"
ARG LANG="en_US.UTF-8"
ARG BUILD_DEV_IMAGE="false"
ARG ADD_DEB_PACKAGES="python3-gdal python3-psycopg2 python3-xarray python3-scipy python3-netcdf4 python3-rasterio python3-fiona python3-pandas python3-pyproj python3-elasticsearch python3-pymongo python3-zarr python3-dask python3-tinydb"
# ENV settings
ENV TZ=${TIMEZONE} \
DEBIAN_FRONTEND="noninteractive" \
DEB_BUILD_DEPS="software-properties-common curl unzip" \
DEB_PACKAGES="python3-pip python3-setuptools python3-distutils python3-shapely python3-yaml python3-dateutil python3-tz python3-flask python3-flask-cors python3-unicodecsv python3-click python3-greenlet python3-gevent python3-wheel gunicorn libsqlite3-mod-spatialite ${ADD_DEB_PACKAGES}"
ENV TZ=${TZ} \
LANG=${LANG} \
DEBIAN_FRONTEND="noninteractive" \
DEB_BUILD_DEPS="software-properties-common curl unzip" \
DEB_PACKAGES="locales locales-all python3-pip python3-setuptools python3-distutils python3-shapely python3-yaml python3-dateutil python3-tz python3-flask python3-flask-cors python3-unicodecsv python3-click python3-greenlet python3-gevent python3-wheel gunicorn libsqlite3-mod-spatialite ${ADD_DEB_PACKAGES}"
RUN mkdir -p /pygeoapi/pygeoapi
# Add files required for pip/setuptools
@@ -77,26 +78,28 @@ ADD pygeoapi/__init__.py /pygeoapi/pygeoapi/
# Run all installs
RUN \
# Install dependencies
apt-get update -y \
&& apt-get install -y --fix-missing --no-install-recommends ${DEB_BUILD_DEPS} \
&& add-apt-repository ppa:ubuntugis/ubuntugis-unstable \
&& apt-get --no-install-recommends install -y ${DEB_PACKAGES} \
&& echo "For ${TZ} date=$(date)" && echo "Locale=$(locale)" \
# Install pygeoapi
&& cd /pygeoapi \
# Optionally add development/test/doc packages
&& if [ "$BUILD_DEV_IMAGE" = "true" ] ; then pip3 install -r requirements-dev.txt; fi \
&& pip3 install -e . \
# OGC schemas local setup
&& mkdir /schemas.opengis.net \
&& curl -O http://schemas.opengis.net/SCHEMAS_OPENGIS_NET.zip \
&& unzip ./SCHEMAS_OPENGIS_NET.zip "ogcapi/*" -d /schemas.opengis.net \
&& rm -f ./SCHEMAS_OPENGIS_NET.zip \
# Cleanup TODO: remove unused Locales and TZs
&& apt-get remove --purge -y ${DEB_BUILD_DEPS} \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
# Install dependencies
apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y --fix-missing --no-install-recommends ${DEB_BUILD_DEPS} \
&& add-apt-repository ppa:ubuntugis/ubuntugis-unstable \
&& apt-get --no-install-recommends install -y ${DEB_PACKAGES} \
&& update-locale LANG=${LANG} \
&& echo "For ${TZ} date=$(date)" && echo "Locale=$(locale)" \
# Install pygeoapi
&& cd /pygeoapi \
# Optionally add development/test/doc packages
&& if [ "$BUILD_DEV_IMAGE" = "true" ] ; then pip3 install -r requirements-dev.txt; fi \
&& pip3 install -e . \
# OGC schemas local setup
&& mkdir /schemas.opengis.net \
&& curl -O http://schemas.opengis.net/SCHEMAS_OPENGIS_NET.zip \
&& unzip ./SCHEMAS_OPENGIS_NET.zip "ogcapi/*" -d /schemas.opengis.net \
&& rm -f ./SCHEMAS_OPENGIS_NET.zip \
# Cleanup TODO: remove unused Locales and TZs
&& apt-get remove --purge -y ${DEB_BUILD_DEPS} \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
ADD . /pygeoapi