[GRASS-SVN] r73292 - grass/branches/releasebranch_7_4

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Sep 7 23:47:36 PDT 2018


Author: neteler
Date: 2018-09-07 23:47:36 -0700 (Fri, 07 Sep 2018)
New Revision: 73292

Modified:
   grass/branches/releasebranch_7_4/Dockerfile
Log:
Dockerfile: partial sync to trunk

Modified: grass/branches/releasebranch_7_4/Dockerfile
===================================================================
--- grass/branches/releasebranch_7_4/Dockerfile	2018-09-08 06:40:44 UTC (rev 73291)
+++ grass/branches/releasebranch_7_4/Dockerfile	2018-09-08 06:47:36 UTC (rev 73292)
@@ -11,14 +11,8 @@
 
 # GRASS GIS compile dependencies
 RUN apt-get update \
-    && apt-get install -y --install-recommends \
-        autoconf2.13 \
-        autotools-dev \
-        bison \
+    && apt-get install -y --no-install-recommends --no-install-suggests \
         build-essential \
-        flex \
-        g++ \
-        gettext \
         libblas-dev \
         libbz2-dev \
         libcairo2-dev \
@@ -30,6 +24,7 @@
         libgsl0-dev \
         libjpeg-dev \
         liblapack-dev \
+        liblas-dev \
         liblas-c-dev \
         libncurses5-dev \
         libnetcdf-dev \
@@ -42,6 +37,10 @@
         libsqlite3-dev \
         libtiff-dev \
         libxmu-dev \
+        bison \
+        flex \
+        g++ \
+        gettext \
         gdal-bin \
         libfftw3-bin \
         make \
@@ -62,6 +61,8 @@
     && apt-get clean && \
     mkdir -p $DATA_DIR
 
+RUN echo LANG="en_US.UTF-8" > /etc/default/locale
+
 RUN mkdir /code
 RUN mkdir /code/grass
 
@@ -70,25 +71,42 @@
 
 WORKDIR /code/grass
 
-# install GRASS GIS
+# Set gcc/g++ environmental variables for GRASS GIS compilation, without debug symbols
+ENV MYCFLAGS "-O2 -march=native -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 NUMTHREADS=2
 RUN ./configure \
     --enable-largefile \
     --with-cxx \
     --with-nls \
     --with-readline \
+    --with-sqlite \
     --with-bzlib \
-    --with-cairo \
+    --with-cairo --with-cairo-ldflags=-lfontconfig \
+    --with-freetype --with-freetype-includes="/usr/include/freetype2/" \
+    --with-fftw \
+    --with-netcdf \
     --with-liblas --with-liblas-config=/usr/bin/liblas-config \
-    --with-freetype --with-freetype-includes="/usr/include/freetype2/" \
-    --with-proj-share=/usr/share/proj \
+    --with-proj --with-proj-share=/usr/share/proj \
     --with-geos=/usr/bin/geos-config \
+    --with-postgres --with-postgres-includes="/usr/include/postgresql" \
     --with-opengl-libs=/usr/include/GL \
-    --with-sqlite \
-    && make -j2 && make install && ldconfig
+    && make -j $NUMTHREADS && make install && ldconfig
 
 # enable simple grass command regardless of version number
 RUN ln -s /usr/local/bin/grass* /usr/local/bin/grass
 
+# Reduce the image size
+RUN apt-get autoremove -y
+RUN apt-get clean -y
+
 # Fix permissions
 RUN chmod -R a+rwx $DATA_DIR
 
@@ -95,10 +113,13 @@
 # create a user
 RUN useradd -m -U grass
 
-# declare volume late so permissions apply
+# declare data volume late so permissions apply
 VOLUME $DATA_DIR
 WORKDIR $DATA_DIR
 
+# Further reduce the docker image size 
+RUN rm -rf /code/grass
+
 # switch the user
 USER grass
 



More information about the grass-commit mailing list