[GRASS-user] About grass-gis:main-ubuntu_wxgui docker

Hi All,

I build my docker image using main-ubuntu_wxgui [1] as the base.
I need to have the GRASS GUI working in my docker container.

After successfully building my docker image and running the
docker image, GRASS starts only in text mode. I was expecting
that it would start in GUI mode.

When I run the command "grass --gui" in the docker bash shell,
I get a message

"Launching <wxpython> GUI in the background, please wait.."
and the GRASS GUI never starts up.

I can only use GRASS in CLI mode inside the docker.

Any suggestion to get the GRASS GIS running in docker?

Best,

Venka

[1] https://hub.docker.com/layers/osgeo/grass-gis/main-ubuntu_wxgui/images/sha256-d1226ca5ead5b184c879049e461a0034e49572511c48030b6e5a0ccef04f2210?context=explore

Hi Venka,

On Sat, Aug 31, 2024 at 1:28 AM Venka via grass-user
<grass-user@lists.osgeo.org> wrote:

Hi All,

I build my docker image using main-ubuntu_wxgui [1] as the base.
I need to have the GRASS GUI working in my docker container.

After successfully building my docker image and running the
docker image, GRASS starts only in text mode. I was expecting
that it would start in GUI mode.

When I run the command "grass --gui" in the docker bash shell,
I get a message

"Launching <wxpython> GUI in the background, please wait.."
and the GRASS GUI never starts up.

I can only use GRASS in CLI mode inside the docker.

Any suggestion to get the GRASS GIS running in docker?

Two suggestions:
- I just submitted a bugfix (say, two) in this pull request (PR):
   https://github.com/OSGeo/grass/pull/4268
- to run it, be sure to redirect the display. E.g. (also works nicely
with podman):

docker run -it --rm --volume="$(pwd)/:/data"
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
            --env DISPLAY=$DISPLAY
--device="/dev/dri/card0:/dev/dri/card0" some_hash_or_image_name \
            grass --gui

Once the PR above is accepted and merged, the updated docker image
should be generated and available to you.

Best,
Markus

--
Markus Neteler, PhD
https://www.mundialis.de - company
https://grass.osgeo.org - FOSS
https://neteler.org - freelancing & blog

Hi Markus,

As always, many thanks.

That worked like a charm!

Best,

Venka

On 9/3/2024 1:57 AM, Markus Neteler wrote:

Hi Venka,

On Sat, Aug 31, 2024 at 1:28 AM Venka via grass-user
<grass-user@lists.osgeo.org> wrote:

Hi All,

I build my docker image using main-ubuntu_wxgui [1] as the base.
I need to have the GRASS GUI working in my docker container.

After successfully building my docker image and running the
docker image, GRASS starts only in text mode. I was expecting
that it would start in GUI mode.

When I run the command "grass --gui" in the docker bash shell,
I get a message

"Launching <wxpython> GUI in the background, please wait.."
and the GRASS GUI never starts up.

I can only use GRASS in CLI mode inside the docker.

Any suggestion to get the GRASS GIS running in docker?

Two suggestions:
- I just submitted a bugfix (say, two) in this pull request (PR):
    https://github.com/OSGeo/grass/pull/4268
- to run it, be sure to redirect the display. E.g. (also works nicely
with podman):

docker run -it --rm --volume="$(pwd)/:/data"
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
             --env DISPLAY=$DISPLAY
--device="/dev/dri/card0:/dev/dri/card0" some_hash_or_image_name \
             grass --gui

Once the PR above is accepted and merged, the updated docker image
should be generated and available to you.

Best,
Markus