[GRASS-user] Create location fails in docker

Margherita Di Leo diregola at gmail.com
Wed Sep 29 12:32:26 PDT 2021


Hi,

I need to run GRASS in a docker image but I have issues apparently about
permissions.

My docker image is built on a dockerfile:

----------------------------------------
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

ENV DATA_DIR /data

RUN apt-get update \
    && apt-get install -y --no-install-recommends --no-install-suggests \
        build-essential \
        libblas-dev \
        libbz2-dev \
        libcairo2-dev \
        libfftw3-dev \
        libfreetype6-dev \
        libgdal-dev \
        libgeos-dev \
        libglu1-mesa-dev \
        libgsl0-dev \
        libjpeg-dev \
        liblapack-dev \
        libncurses5-dev \
        libnetcdf-dev \
        libopenjp2-7 \
        libopenjp2-7-dev \
        libpdal-dev pdal \
        libpdal-plugin-python \
        libpng-dev \
        libpq-dev \
        libproj-dev \
        libreadline-dev \
        libsqlite3-dev \
        libtiff-dev \
        libxmu-dev \
        libzstd-dev \
        bison \
        flex \
        g++ \
        gettext \
        gdal-bin \
        grass \
        grass-core \
        grass-dev \
        libfftw3-bin \
        make \
        ncurses-bin \
        netcdf-bin \
        proj-bin \
        proj-data \
        python3 \
        python3-dev \
        python3-geopandas \
        python3-numpy \
        python3-pandas \
        python3-pil \
        python3-ply \
        python3-six \
        sqlite3 \
        subversion \
        unixodbc-dev \
        zlib1g-dev \
    && apt-get autoremove \
    && apt-get clean && \
    mkdir -p $DATA_DIR

ENV SHELL /bin/bash

# permissions
RUN chmod -R a+rwx $DATA_DIR

# create user
RUN useradd -m -U digitranscope

VOLUME $DATA_DIR
WORKDIR $DATA_DIR

# switch user
USER digitranscope

CMD ["grass", "--version"]

----------------------------------------

Then, from a bash script I try to create a location and exit, but it seems
to fail on this:

grass --text -c EPSG:4326 $GRASSDATA\/france -e

The error message:

Traceback (most recent call last):
  File "/usr/bin/grass", line 390, in get_grass_config_dir
    os.mkdir(directory)
PermissionError: [Errno 13] Permission denied: '/.grass7'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/grass", line 2218, in <module>
    main()
  File "/usr/bin/grass", line 2001, in main
    grass_config_dir = get_grass_config_dir()
  File "/usr/bin/grass", line 395, in get_grass_config_dir
    _("Failed to create configuration directory '%s' with error: %s")
NameError: name '_' is not defined
Traceback (most recent call last):
  File "/usr/bin/grass", line 390, in get_grass_config_dir
    os.mkdir(directory)
PermissionError: [Errno 13] Permission denied: '/.grass7'

What could be the problem?

Thanks in advance

-- 
Margherita Di Leo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20210929/7de65aa5/attachment.html>


More information about the grass-user mailing list