Docker and GUI Desktop

Hi!

I am looking into on how to run QGIS-desktop in Docker.

  • I am running on Ubuntu 19.
  • Docker version 19.03.12, build 48a66213fe
  • docker-compose version 1.23.2, build 1110ad01

Here is the repo by Kartoza (https://github.com/kartoza/docker-qgis-desktop).
And here is the example from the page:

db:
  image: kartoza/postgis:9.4-2.1
  environment:
    - USERNAME=docker
    - PASS=docker
  
qgisdesktop:
  image: kartoza/qgis-desktop:2.14
  hostname: qgis-server
  volumes:
    # Wherever you want to mount your data from
    - ./gis:/gis
    # Unix socket for X11
    - /tmp/.X11-unix:/tmp/.X11-unix
  links:
    - db:db
  environment: 
    - DISPLAY=unix:1
  command: /usr/bin/qgis

So I am failing on the DISPLAY=unix:1 environment variable
and the error is like this:
qgisdesktop_1 | Warning: qgis: cannot connect to X server unix:1

Is my problem to be found there or is it something else ?

best, i

HI,

Some more information.
I found the following code on docker-hub as a docker run-command (https://hub.docker.com/r/kartoza/qgis-desktop)

xhost +
# Users home is mounted as home
# --rm will remove the container as soon as it ends

docker run --rm --name="qgis-desktop-2.10" \
    -i -t \
    -v ${HOME}:/home/${USER} \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -e DISPLAY=unix$DISPLAY \
    kartoza/qgis-desktop:latest 
xhost -

Would that be hard to package that in a docker-compose.yml-file ? and link it to the postgis-database ? is the magic here the xhost - ?

The repo (https://github.com/kartoza/docker-qgis-desktop) has not been updated since 2018 - so I guess that would be hard to upgrade it to the latest qgis-versions or there are other difficulties in maintaining this project … what would be your guess ?
I have seen another project where rStudio is started up in a docker-container and accessible from a browser - would that even be preferable when it comes to the qgis-desktop ?
Any advice on how to move forward is appreaciated.

The Dashboard is a feature of Docker Desktop

On the taskbar (in Windows), find the Docker Desktop icon and left click it. The popup menu will show one of the commands being “Dashboard”. It will open to a window doing what was explained.

See this page for more.

Thank you smhbizness.
But does this answer my initial question about running qgis-desktop in a docker-container ?
How would you go about running the latest qgis-desktop in Docker desktop ?

best,i