[GRASS-dev] Docker image based on Alpine Linux with GRASS GIS 7.7.git and wxGUI

Hi,

I am trying to create a docker image with wxGUI.

After hours of attempts (since Alpine does not offer the wxPython
package, so it needs to be pip installed in the Dcokerfile) I got it
build:

https://hub.docker.com/r/neteler/docker-alpine-grass-gis-gui

# fetch image
docker pull neteler/docker-alpine-grass-gis-gui

# run image
docker run -i -t --rm -v $(pwd):/tmp -v /tmp/.X11-unix:/tmp/.X11-unix
-e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name grass77
neteler/docker-alpine-grass-gis-gui grass77 --gui
Starting GRASS GIS...
WARNING: GRASS GUI not found. Please check your installation.
Switching to text based interface mode.

Hit RETURN to continue.

As you see - no GUI while g.gui is there!?

# interactive test
docker run -i -t --rm -v $(pwd):/tmp -v /tmp/.X11-unix:/tmp/.X11-unix
-e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name grass77
neteler/docker-alpine-grass-gis-gui /bin/bash

bash-5.0# grass77 /tmp/grassdata/nc_spm_08_grass7/user1/
Starting GRASS GIS...
WARNING: GRASS GUI not found. Please check your installation.
Switching to text based interface mode.
Hit RETURN to continue.
Cleaning up temporary files...

          __________ ___ __________ _______________
         / ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/
        / / __/ /_/ / /| | \__ \\_ \ / / __ / / \__ \
       / /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ /
       \____/_/ |_/_/ |_/____/____/ \____/___//____/

Welcome to GRASS GIS 7.7.dev\
GRASS GIS homepage: https://grass.osgeo.org
This version running through: Bash Shell (/bin/bash)
Help is available with the command: g.manual -i
See the licence terms with: g.version -c
See citation options with: g.version -x
Start the GUI with: g.gui wxpython
When ready to quit enter: exit

GRASS 7.7.dev (nc_spm_08_grass7):/grassdb > g.gui
ERROR: Your installation doesn't include GUI, exiting.

GRASS 7.7.dev (nc_spm_08_grass7):/grassdb > ldd $(which g.gui)
    /lib/ld-musl-x86_64.so.1 (0x7fcf65ef1000)
    libgrass_gis.7.7.so => /usr/local/grass77/lib/libgrass_gis.7.7.so
(0x7fcf65e71000)
    libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fcf65ef1000)
    libgrass_datetime.7.7.so =>
/usr/local/grass77/lib/libgrass_datetime.7.7.so (0x7fcf65e65000)
    libz.so.1 => /lib/libz.so.1 (0x7fcf65c4e000)
    libbz2.so.1 => /usr/lib/libbz2.so.1 (0x7fcf65c3f000)
    libzstd.so.1 => /usr/lib/libzstd.so.1 (0x7fcf65b99000)

bash-5.0# python3
Python 3.7.3 (default, Apr 17 2019, 11:48:37)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import wx

Looks ok.

I suspect some missing lib on my Alpine image but have no idea which one.

Does anyone has an idea?

thanks,
Markus

On Tue, Jul 30, 2019 at 6:32 PM Markus Neteler <neteler@osgeo.org> wrote:

Hi,

I am trying to create a docker image with wxGUI.

After hours of attempts (since Alpine does not offer the wxPython
package, so it needs to be pip installed in the Dcokerfile) I got it
build:

https://hub.docker.com/r/neteler/docker-alpine-grass-gis-gui

fetch image

docker pull neteler/docker-alpine-grass-gis-gui

run image

docker run -i -t --rm -v $(pwd):/tmp -v /tmp/.X11-unix:/tmp/.X11-unix
-e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name grass77
neteler/docker-alpine-grass-gis-gui grass77 --gui
Starting GRASS GIS…
WARNING: GRASS GUI not found. Please check your installation.
Switching to text based interface mode.

Hit RETURN to continue.

As you see - no GUI while g.gui is there!?

interactive test

docker run -i -t --rm -v $(pwd):/tmp -v /tmp/.X11-unix:/tmp/.X11-unix
-e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name grass77
neteler/docker-alpine-grass-gis-gui /bin/bash

bash-5.0# grass77 /tmp/grassdata/nc_spm_08_grass7/user1/
Starting GRASS GIS…
WARNING: GRASS GUI not found. Please check your installation.
Switching to text based interface mode.
Hit RETURN to continue.
Cleaning up temporary files…


/ / __ / | / / / / __/ / /
/ / __/ /
/ / /| | _
\
\ / / __ / / _

/ /
/ / , / ___ |
/ /
/ / / /
/ // / / /
_
/
/ |
/
/ |
/
// _///_/

Welcome to GRASS GIS 7.7.dev
GRASS GIS homepage: https://grass.osgeo.org
This version running through: Bash Shell (/bin/bash)
Help is available with the command: g.manual -i
See the licence terms with: g.version -c
See citation options with: g.version -x
Start the GUI with: g.gui wxpython
When ready to quit enter: exit

GRASS 7.7.dev (nc_spm_08_grass7):/grassdb > g.gui
ERROR: Your installation doesn’t include GUI, exiting.

not sure if that helps but this error probably comes from general/g.gui/main.c:

sprintf(progname, “%s/gui/wxpython/wxgui.py”, G_gisbase());
if (access(progname, F_OK) == -1)

G_fatal_error(_(“Your installation doesn’t include GUI, exiting.”));

GRASS 7.7.dev (nc_spm_08_grass7):/grassdb > ldd $(which g.gui)
/lib/ld-musl-x86_64.so.1 (0x7fcf65ef1000)
libgrass_gis.7.7.so => /usr/local/grass77/lib/libgrass_gis.7.7.so
(0x7fcf65e71000)
libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fcf65ef1000)
libgrass_datetime.7.7.so =>
/usr/local/grass77/lib/libgrass_datetime.7.7.so (0x7fcf65e65000)
libz.so.1 => /lib/libz.so.1 (0x7fcf65c4e000)
libbz2.so.1 => /usr/lib/libbz2.so.1 (0x7fcf65c3f000)
libzstd.so.1 => /usr/lib/libzstd.so.1 (0x7fcf65b99000)

bash-5.0# python3
Python 3.7.3 (default, Apr 17 2019, 11:48:37)
[GCC 8.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import wx

Looks ok.

I suspect some missing lib on my Alpine image but have no idea which one.

Does anyone has an idea?

thanks,
Markus


grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

On Wed, Jul 31, 2019 at 5:04 AM Anna Petrášová <kratochanna@gmail.com> wrote:

On Tue, Jul 30, 2019 at 6:32 PM Markus Neteler <neteler@osgeo.org> wrote:

Hi,

I am trying to create a docker image with wxGUI.

...

# interactive test
docker run -i -t --rm -v $(pwd):/tmp -v /tmp/.X11-unix:/tmp/.X11-unix
-e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name grass77
neteler/docker-alpine-grass-gis-gui /bin/bash

bash-5.0# grass77 /tmp/grassdata/nc_spm_08_grass7/user1/

...

GRASS 7.7.dev (nc_spm_08_grass7):/grassdb > g.gui
ERROR: Your installation doesn't include GUI, exiting.

not sure if that helps but this error probably comes from general/g.gui/main.c:

    sprintf(progname, "%s/gui/wxpython/wxgui.py", G_gisbase());
    if (access(progname, F_OK) == -1)
        G_fatal_error(_("Your installation doesn't include GUI, exiting."));

In fact, $GISBASE/gui/wxpython/wxgui.py isn't present in the docker image.

Do you have an idea what to look for (say, what does it (not) generate)?

thanks
Markus

On Wed, Jul 31, 2019 at 11:41 AM Markus Neteler <neteler@osgeo.org> wrote:

In fact, $GISBASE/gui/wxpython/wxgui.py isn’t present in the docker image.

Do you have an idea what to look for (say, what does it (not) generate)?

Hi Markus, wxgui.py is a file copied from source to distribution by make, so the question is what compilation output says.

Hi,

On Thu, Aug 1, 2019 at 1:59 AM Vaclav Petras <wenzeslaus@gmail.com> wrote:

On Wed, Jul 31, 2019 at 11:41 AM Markus Neteler <neteler@osgeo.org> wrote:

In fact, $GISBASE/gui/wxpython/wxgui.py isn't present in the docker image.

Do you have an idea what to look for (say, what does it (not) generate)?

Hi Markus, wxgui.py is a file copied from source to distribution by make, so the question is what compilation output says.

https://cloud.docker.com/repository/registry-1.docker.io/neteler/docker-alpine-grass-gis-gui/builds/c8c39f18-33cb-44df-a669-23f8cdc5682f

...
/usr/bin/install -c -m 644 image2target/ii2t_toolbars.py
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/image2target/ii2t_toolbars.py
/usr/bin/install -c -m 644 gis_set.py
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/gis_set.py
/usr/bin/install -c -m 644 gis_set_error.py
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/gis_set_error.py
/usr/bin/install -c -m 644 wxgui.py
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/wxgui.py
/usr/bin/install -c -m 644 README
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/README
python3 -t -m py_compile
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/icons/__init__.py
python3 -t -m py_compile
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/icons/icon.py
python3 -t -m py_compile
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/icons/grass_icons.py
...

There is no error at all...
Anything else I can look for?

thanks
Markus

On Thu, Aug 1, 2019 at 1:22 PM Markus Neteler <neteler@osgeo.org> wrote:

Hi,

On Thu, Aug 1, 2019 at 1:59 AM Vaclav Petras <wenzeslaus@gmail.com> wrote:

On Wed, Jul 31, 2019 at 11:41 AM Markus Neteler <neteler@osgeo.org> wrote:

In fact, $GISBASE/gui/wxpython/wxgui.py isn’t present in the docker image.

Do you have an idea what to look for (say, what does it (not) generate)?

Hi Markus, wxgui.py is a file copied from source to distribution by make, so the question is what compilation output says.

https://cloud.docker.com/repository/registry-1.docker.io/neteler/docker-alpine-grass-gis-gui/builds/c8c39f18-33cb-44df-a669-23f8cdc5682f

The link does not work for me. Do I have to create an account?

/usr/bin/install -c -m 644 wxgui.py
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/wxgui.py

This says /src/grass_build/dist.x86_64-pc-linux-gnu/. I assume it is from “make” but the GRASS GIS there is running from /usr/local/grass77, so I assume there is also the “make install” step?

I did:

$ docker run -i -t --rm -v $(pwd):/tmp -v /tmp/.X11-unix:/tmp/.X11-unix -e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name grass77 neteler/docker-alpine-grass-gis-gui grass77 --tmp-location XY --exec bash

$ ls /src
$ echo $GISBASE
/usr/local/grass77
$ ls $GISBASE/gui
ls: /usr/local/grass77/gui: No such file or directory

On Thu, Aug 1, 2019 at 9:23 PM Vaclav Petras <wenzeslaus@gmail.com> wrote:

On Thu, Aug 1, 2019 at 1:22 PM Markus Neteler <neteler@osgeo.org> wrote:

Hi,

On Thu, Aug 1, 2019 at 1:59 AM Vaclav Petras <wenzeslaus@gmail.com> wrote:
> On Wed, Jul 31, 2019 at 11:41 AM Markus Neteler <neteler@osgeo.org> wrote:
>>
>> In fact, $GISBASE/gui/wxpython/wxgui.py isn't present in the docker image.
>>
>> Do you have an idea what to look for (say, what does it (not) generate)?
>
>
> Hi Markus, wxgui.py is a file copied from source to distribution by make, so the question is what compilation output says.

https://cloud.docker.com/repository/registry-1.docker.io/neteler/docker-alpine-grass-gis-gui/builds/c8c39f18-33cb-44df-a669-23f8cdc5682f

The link does not work for me. Do I have to create an account?

I guess it is only visible to me.
I have downloaded it - you can get it now from here:

https://data.neteler.org/tmp/alpine_grass_wxgui_dockerhub.log.gz

/usr/bin/install -c -m 644 wxgui.py
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/wxgui.py

This says /src/grass_build/dist.x86_64-pc-linux-gnu/. I assume it is from "make" but the GRASS GIS there is running from /usr/local/grass77, so I assume there is also the "make install" step?

Yes:
https://github.com/OSGeo/grass/blob/master/docker/Dockerfile_alpine_wxgui#L198

I did:

$ docker run -i -t --rm -v $(pwd):/tmp -v /tmp/.X11-unix:/tmp/.X11-unix -e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name grass77 neteler/docker-alpine-grass-gis-gui grass77 --tmp-location XY --exec bash
...
$ ls /src
$ echo $GISBASE
/usr/local/grass77
$ ls $GISBASE/gui
ls: /usr/local/grass77/gui: No such file or directory

Exactly. Apparently there is a condition somewhere in the wxGUI Makefiles?

Markus

Hi,

No Idea if it helps: for our national e-infrastructure I had to customize a docker file based on Ubuntu. There, I initially also struggled with the GUI (import error for wx), but after adding the packages here:
https://github.com/ninsbl/doctest/blob/master/novnc/Dockerfile#L156 (until line 162)
It worked with GRASS 7.9 and Python3 in a Docker container.

The Dockerfile contains lots of packages, so I cannot guarantee that other packages I had installed earlier are not required in addition...

Cheers
Stefan

-----Original Message-----
From: grass-dev <grass-dev-bounces@lists.osgeo.org> On Behalf Of Markus Neteler
Sent: fredag 2. august 2019 00:51
To: Vaclav Petras <wenzeslaus@gmail.com>
Cc: GRASS developers list <grass-dev@lists.osgeo.org>
Subject: Re: [GRASS-dev] Docker image based on Alpine Linux with GRASS GIS 7.7.git and wxGUI

On Thu, Aug 1, 2019 at 9:23 PM Vaclav Petras <wenzeslaus@gmail.com> wrote:

On Thu, Aug 1, 2019 at 1:22 PM Markus Neteler <neteler@osgeo.org> wrote:

Hi,

On Thu, Aug 1, 2019 at 1:59 AM Vaclav Petras <wenzeslaus@gmail.com> wrote:
> On Wed, Jul 31, 2019 at 11:41 AM Markus Neteler <neteler@osgeo.org> wrote:
>>
>> In fact, $GISBASE/gui/wxpython/wxgui.py isn't present in the docker image.
>>
>> Do you have an idea what to look for (say, what does it (not) generate)?
>
>
> Hi Markus, wxgui.py is a file copied from source to distribution by make, so the question is what compilation output says.

https://cloud.docker.com/repository/registry-1.docker.io/neteler/dock
er-alpine-grass-gis-gui/builds/c8c39f18-33cb-44df-a669-23f8cdc5682f

The link does not work for me. Do I have to create an account?

I guess it is only visible to me.
I have downloaded it - you can get it now from here:

https://data.neteler.org/tmp/alpine_grass_wxgui_dockerhub.log.gz

/usr/bin/install -c -m 644 wxgui.py
/src/grass_build/dist.x86_64-pc-linux-gnu/gui/wxpython/wxgui.py

This says /src/grass_build/dist.x86_64-pc-linux-gnu/. I assume it is from "make" but the GRASS GIS there is running from /usr/local/grass77, so I assume there is also the "make install" step?

Yes:
https://github.com/OSGeo/grass/blob/master/docker/Dockerfile_alpine_wxgui#L198

I did:

$ docker run -i -t --rm -v $(pwd):/tmp -v
/tmp/.X11-unix:/tmp/.X11-unix -e uid=$(id -u) -e gid=$(id -g) -e DISPLAY=unix$DISPLAY --name grass77 neteler/docker-alpine-grass-gis-gui grass77 --tmp-location XY --exec bash ...
$ ls /src
$ echo $GISBASE
/usr/local/grass77
$ ls $GISBASE/gui
ls: /usr/local/grass77/gui: No such file or directory

Exactly. Apparently there is a condition somewhere in the wxGUI Makefiles?

Markus
_______________________________________________
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev

Hi,
btw, we have revisited the Dockerfiles and now have all in one repo
with different tags:

https://hub.docker.com/r/mundialis/grass-py3-pdal/tags

- based on Alpine, Debian, Ubuntu as base images
- stable 7.8.dev and master 7.9.dev
- PDAL included
- PROJ and GDAL versions depend on the base image

Cheers
Markus

--
Markus Neteler, PhD
https://www.mundialis.de - free data with free software
https://grass.osgeo.org
https://courses.neteler.org/blog