Explorar o código

Dockerfile: 'set ENV SHELL' to avoid /bin/sh fallback in interactive GRASS GIS sessions in docker

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73290 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler %!s(int64=6) %!d(string=hai) anos
pai
achega
c645d7eedb
Modificáronse 2 ficheiros con 6 adicións e 2 borrados
  1. 5 1
      Dockerfile
  2. 1 1
      lib/init/grass.py

+ 5 - 1
Dockerfile

@@ -84,6 +84,7 @@ ENV CFLAGS "$MYCFLAGS"
 ENV CXXFLAGS "$MYCXXFLAGS"
 
 # Configure, compile and install GRASS GIS
+ENV NUMTHREADS=2
 RUN ./configure \
     --enable-largefile \
     --with-cxx \
@@ -102,7 +103,7 @@ RUN ./configure \
     --with-geos=/usr/bin/geos-config \
     --with-postgres --with-postgres-includes="/usr/include/postgresql" \
     --with-opengl-libs=/usr/include/GL \
-    && 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
@@ -111,6 +112,9 @@ RUN ln -s /usr/local/bin/grass* /usr/local/bin/grass
 RUN apt-get autoremove -y
 RUN apt-get clean -y
 
+# set SHELL var to avoid /bin/sh fallback in interactive GRASS GIS sessions in docker
+ENV SHELL /bin/bash
+
 # Fix permissions
 RUN chmod -R a+rwx $DATA_DIR
 

+ 1 - 1
lib/init/grass.py

@@ -1470,7 +1470,7 @@ def get_shell():
         os.environ['OSTYPE'] = "cygwin"
     else:
         # in docker the 'SHELL' variable may not be
-        # visible in a Python session
+        # visible in a Python session unless 'ENV SHELL /bin/bash' is set in Dockerfile
         try:
             sh = os.path.basename(os.getenv('SHELL'))
         except: