Prechádzať zdrojové kódy

docker: update Ubuntu based images (#1180)

* docker: update Ubuntu based images

- update to ubuntu:20.04 base image
- cleanup potentially leftover GISRC file with wrong path to "demolocation"
- use PROJ from Ubuntu

* avoid hardcoded ARCH

* generalize .grassrc79 to .grassrc7?

* removed outdated Ubuntu19 docker image
Markus Neteler 4 rokov pred
rodič
commit
8596c7d6a4

+ 3 - 5
docker/README.md

@@ -4,17 +4,15 @@
 
 | Base image   | Docker tag      | GRASS GIS  | PROJ  | GDAL  | PDAL  | Python | Image size |
 |--------------|-----------------|------------|-------|-------|-------|--------|------------|
-| Ubuntu 18.04 | latest-ubuntu   | 7.9.dev    | 4.9.3 | 2.2.3 | 1.8.0 | 3.6.9  | 1.04 GB    |
-| Ubuntu 19.10 | latest-ubuntu19 | 7.9.dev    | 5.2.0 | 2.4.2 | 1.9.1 | 3.7.5  |  850 MB    |
+| Ubuntu 20.04 | latest-ubuntu   | 7.9.dev    | 6.3.1 | 3.0.4 | 2.2.0 | 3.8.5  | 1.04 GB    |
 | Debian 10.1  | latest-debian   | 7.9.dev    | 5.2.0 | 2.4.0 | 1.8.0 | 3.7.3  | 1.14 GB    |
 | Alpine 3.12  | latest-alpine   | 7.9.dev    | 7.0.1 | 3.1.2 | 2.1.0 | 3.5.8  |  385 MB    |
 |--------------|-----------------|------------|-------|-------|-------|--------|------------|
-| Ubuntu 18.04 | stable-ubuntu   | 7.8 branch | 4.9.3 | 2.2.3 | 1.8.0 | 3.6.9  | 1.04 GB    |
-| Ubuntu 19.10 | stable-ubuntu19 | 7.8 branch | 5.2.0 | 2.4.2 | 1.9.1 | 3.7.5  |  850 MB    |
+| Ubuntu 20.04 | stable-ubuntu   | 7.8 branch | 6.3.1 | 3.0.4 | 2.2.0 | 3.8.5  | 1.04 GB    |
 | Debian 10.1  | stable-debian   | 7.8 branch | 5.2.0 | 2.4.0 | 1.8.0 | 3.7.3  | 1.14 GB    |
 | Alpine 3.12  | stable-alpine   | 7.8 branch | 7.0.1 | 3.1.2 | 2.1.0 | 3.5.8  |  385 MB    |
 
-Last update: 17 Sep 2020 (source: https://hub.docker.com/r/mundialis/grass-py3-pdal/builds)
+Last update: 16 Dec 2020 (source: https://hub.docker.com/r/mundialis/grass-py3-pdal/builds)
 
 # Requirements
 

+ 0 - 194
docker/ubuntu/Dockerfile_ubuntu_latest_pdal

@@ -1,194 +0,0 @@
-FROM ubuntu:19.10
-
-LABEL authors="Carmen Tawalika,Markus Neteler,Anika Bettge"
-LABEL maintainer="tawalika@mundialis.de,neteler@mundialis.de,bettge@mundialis.de"
-
-ENV DEBIAN_FRONTEND noninteractive
-
-SHELL ["/bin/bash", "-c"]
-
-WORKDIR /tmp
-
-RUN apt-get update && apt-get upgrade -y && \
-    apt-get install -y --no-install-recommends --no-install-suggests \
-    build-essential \
-    bison \
-    bzip2 \
-    cmake \
-    curl \
-    flex \
-    g++ \
-    gcc \
-    gdal-bin \
-    git \
-    language-pack-en-base \
-    libbz2-dev \
-    libcairo2 \
-    libcairo2-dev \
-    libcurl4-gnutls-dev \
-    libfftw3-bin \
-    libfftw3-dev \
-    libfreetype6-dev \
-    libgdal-dev \
-    libgeos-dev \
-    libgsl0-dev \
-    libjpeg-dev \
-    libjsoncpp-dev \
-    libnetcdf-dev \
-    libncurses5-dev \
-    libopenblas-base \
-    libopenblas-dev \
-    libopenjp2-7 \
-    libopenjp2-7-dev \
-    libpdal-dev \
-    libpdal-plugins \
-    libpdal-plugin-python \
-    libpnglite-dev \
-    libpq-dev \
-    libproj-dev \
-    libpython3-all-dev \
-    libsqlite3-dev \
-    libtiff-dev \
-    libzstd-dev \
-    locales \
-    make \
-    mesa-common-dev \
-    moreutils \
-    ncurses-bin \
-    netcdf-bin \
-    pdal \
-    proj-bin \
-    proj-data \
-    python3 \
-    python3-dateutil \
-    python3-dev \
-    python3-magic \
-    python3-numpy \
-    python3-pil \
-    python3-pip \
-    python3-ply \
-    python3-setuptools \
-    python3-venv \
-    software-properties-common \
-    sqlite3 \
-    subversion \
-    unzip \
-    vim \
-    wget \
-    zip \
-    zlib1g-dev
-
-RUN echo LANG="en_US.UTF-8" > /etc/default/locale
-RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && locale-gen
-
-## TODO check if still needed
-## fetch vertical datums and store into PROJ dir
-WORKDIR /src
-RUN mkdir vdatum && \
-    cd vdatum && \
-    wget -q http://download.osgeo.org/proj/vdatum/usa_geoid2012.zip && unzip -j -u usa_geoid2012.zip -d /usr/share/proj; \
-    wget -q http://download.osgeo.org/proj/vdatum/usa_geoid2009.zip && unzip -j -u usa_geoid2009.zip -d /usr/share/proj; \
-    wget -q http://download.osgeo.org/proj/vdatum/usa_geoid2003.zip && unzip -j -u usa_geoid2003.zip -d /usr/share/proj; \
-    wget -q http://download.osgeo.org/proj/vdatum/usa_geoid1999.zip && unzip -j -u usa_geoid1999.zip -d /usr/share/proj; \
-    wget -q http://download.osgeo.org/proj/vdatum/vertcon/vertconc.gtx && mv vertconc.gtx /usr/share/proj; \
-    wget -q http://download.osgeo.org/proj/vdatum/vertcon/vertcone.gtx && mv vertcone.gtx /usr/share/proj; \
-    wget -q http://download.osgeo.org/proj/vdatum/vertcon/vertconw.gtx && mv vertconw.gtx /usr/share/proj; \
-    wget -q http://download.osgeo.org/proj/vdatum/egm96_15/egm96_15.gtx && mv egm96_15.gtx /usr/share/proj; \
-    wget -q http://download.osgeo.org/proj/vdatum/egm08_25/egm08_25.gtx && mv egm08_25.gtx /usr/share/proj; \
-    cd .. && \
-    rm -rf vdatum
-
-# copy grass gis source
-WORKDIR /src
-COPY . /src/grass_build/
-WORKDIR /src/grass_build
-
-# Set environmental variables for GRASS GIS compilation, without debug symbols
-# Set gcc/g++ environmental variables for GRASS GIS compilation, without debug symbols
-ENV MYCFLAGS "-O2 -std=gnu99 -m64"
-ENV MYLDFLAGS "-s"
-# CXX stuff:
-ENV LD_LIBRARY_PATH "/usr/local/lib"
-ENV LDFLAGS "$MYLDFLAGS"
-ENV CFLAGS "$MYCFLAGS"
-ENV CXXFLAGS "$MYCXXFLAGS"
-
-# Configure compile and install GRASS GIS
-ENV GRASS_PYTHON=/usr/bin/python3
-ENV NUMTHREADS=4
-RUN make distclean || echo "nothing to clean"
-RUN /src/grass_build/configure \
-  --with-cxx \
-  --enable-largefile \
-  --with-proj --with-proj-share=/usr/share/proj \
-  --with-gdal=/usr/bin/gdal-config \
-  --with-geos \
-  --with-sqlite \
-  --with-cairo --with-cairo-ldflags=-lfontconfig \
-  --with-freetype --with-freetype-includes="/usr/include/freetype2/" \
-  --with-fftw \
-  --with-postgres=yes --with-postgres-includes="/usr/include/postgresql" \
-  --with-netcdf \
-  --with-zstd \
-  --with-bzlib \
-  --with-pdal \
-  --without-mysql \
-  --without-odbc \
-  --without-openmp \
-  --without-ffmpeg \
-  --without-opengl \
-    && make -j $NUMTHREADS \
-    && make install && ldconfig
-
-# Unset environmental variables to avoid later compilation issues
-ENV INTEL ""
-ENV MYCFLAGS ""
-ENV MYLDFLAGS ""
-ENV MYCXXFLAGS ""
-ENV LD_LIBRARY_PATH ""
-ENV LDFLAGS ""
-ENV CFLAGS ""
-ENV CXXFLAGS ""
-
-# set SHELL var to avoid /bin/sh fallback in interactive GRASS GIS sessions
-ENV SHELL /bin/bash
-ENV LC_ALL "en_US.UTF-8"
-ENV GRASS_SKIP_MAPSET_OWNER_CHECK 1
-
-# Create generic GRASS GIS binary name regardless of version number
-RUN ln -sf `find /usr/local/bin -name "grass??" | sort | tail -n 1` /usr/local/bin/grass
-# Create generic GRASS GIS lib name regardless of version number
-RUN ln -sf `grass --config path` /usr/local/grass
-
-# show GRASS GIS, PROJ, GDAL etc versions
-RUN grass --tmp-location EPSG:4326 --exec g.version -rge && \
-    pdal --version && \
-    python3 --version
-
-# Reduce the image size
-RUN apt-get autoremove -y
-RUN apt-get clean -y
-
-WORKDIR /scripts
-
-# install external GRASS GIS session Python API
-RUN pip3 install grass-session
-
-# install GRASS GIS extensions
-RUN grass --tmp-location EPSG:4326 --exec g.extension extension=r.in.pdal
-
-# add GRASS GIS envs for python usage
-ENV GISBASE "/usr/local/grass/"
-ENV GRASSBIN "/usr/local/bin/grass"
-ENV PYTHONPATH "${PYTHONPATH}:$GISBASE/etc/python/"
-ENV LD_LIBRARY_PATH "$LD_LIBRARY_PATH:$GISBASE/lib"
-
-WORKDIR /tmp
-COPY docker/testdata/simple.laz .
-WORKDIR /scripts
-COPY docker/testdata/test_grass_session.py .
-## just scan the LAZ file
-RUN /usr/bin/python3 /scripts/test_grass_session.py
-
-WORKDIR /grassdb
-VOLUME /grassdb

+ 12 - 21
docker/ubuntu/Dockerfile_ubuntu_pdal

@@ -1,15 +1,13 @@
-FROM ubuntu:18.04
+FROM ubuntu:20.04
 
-LABEL authors="Carmen Tawalika,Markus Neteler,Anika Bettge"
-LABEL maintainer="tawalika@mundialis.de,neteler@mundialis.de,bettge@mundialis.de"
+LABEL authors="Carmen Tawalika,Markus Neteler,Anika Weinmann"
+LABEL maintainer="tawalika@mundialis.de,neteler@mundialis.de,weinmann@mundialis.de"
 
 ENV DEBIAN_FRONTEND noninteractive
 
 # define versions to be used
-ARG PDAL_VERSION=1.8.0
-ARG PROJ_VERSION=4.9.3
-ARG PROJ_DATUMGRID_VERSION=1.8
-ARG LAZ_PERF_VERSION=1.3.0
+ARG PDAL_VERSION=2.2.0
+ARG LAZ_PERF_VERSION=1.5.0
 
 SHELL ["/bin/bash", "-c"]
 
@@ -48,6 +46,7 @@ RUN apt-get update && apt-get upgrade -y && \
     libopenjp2-7-dev \
     libpnglite-dev \
     libpq-dev \
+    libproj-dev \
     libpython3-all-dev \
     libsqlite3-dev \
     libtiff-dev \
@@ -58,6 +57,8 @@ RUN apt-get update && apt-get upgrade -y && \
     moreutils \
     ncurses-bin \
     netcdf-bin \
+    proj-bin \
+    proj-data \
     python3 \
     python3-dateutil \
     python3-dev \
@@ -80,19 +81,6 @@ RUN apt-get update && apt-get upgrade -y && \
 RUN echo LANG="en_US.UTF-8" > /etc/default/locale
 RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && locale-gen
 
-## install the latest projection library for GRASS GIS
-WORKDIR /src
-RUN wget -q http://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz && \
-    tar xzf proj-${PROJ_VERSION}.tar.gz && \
-    cd /src/proj-${PROJ_VERSION}/ && \
-    wget -q http://download.osgeo.org/proj/proj-datumgrid-${PROJ_DATUMGRID_VERSION}.zip && \
-    cd nad && \
-    unzip ../proj-datumgrid-${PROJ_DATUMGRID_VERSION}.zip && \
-    cd .. && \
-    ./configure --prefix=/usr/ && \
-    make && \
-    make install
-
 ## install laz-perf
 RUN apt-get install cmake
 WORKDIR /src
@@ -105,7 +93,7 @@ RUN wget -q https://github.com/hobu/laz-perf/archive/${LAZ_PERF_VERSION}.tar.gz
     make && \
     make install
 
-## fetch vertical datums and store into PROJ dir
+## fetch vertical datums for PDAL and store into PROJ dir
 WORKDIR /src
 RUN mkdir vdatum && \
     cd vdatum && \
@@ -158,6 +146,9 @@ WORKDIR /src
 COPY . /src/grass_build/
 WORKDIR /src/grass_build
 
+# Cleanup potentially leftover GISRC file with wrong path to "demolocation"
+RUN rm -f /src/grass_build/dist.*/demolocation/.grassrc7?
+
 # Set environmental variables for GRASS GIS compilation, without debug symbols
 # Set gcc/g++ environmental variables for GRASS GIS compilation, without debug symbols
 ENV MYCFLAGS "-O2 -std=gnu99 -m64"