Skip to content

Commit

Permalink
Dockerfile: 'set ENV SHELL' to avoid /bin/sh fallback in interactive …
Browse files Browse the repository at this point in the history
…GRASS GIS sessions in docker

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@73290 15284696-431f-4ddb-bdfa-cd5b030d7da7
  • Loading branch information
neteler committed Sep 8, 2018
1 parent 42b1e4b commit c645d7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/init/grass.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c645d7e

Please sign in to comment.