Skip to content

Instantly share code, notes, and snippets.

@stefnestor
Created September 11, 2021 22:22
Show Gist options
  • Save stefnestor/c8154ac3f64a9836b200008a3e99c7de to your computer and use it in GitHub Desktop.
Save stefnestor/c8154ac3f64a9836b200008a3e99c7de to your computer and use it in GitHub Desktop.
Alternative-to-only-previous method of loading QGIS Desktop via Ubuntu Emulator without sharing system/user data

WHY: I frequently have to transfer geospatial projects between work and personal Macs & then get caught catching systems up from recent changes. I really wanted to use github/docker-qgis-desktop (from DockerHub), but felt referencing my system user was sketchy & found it just as problematic when porting.

STEPS: We're going to combine github/docker-ubuntu-vnc-desktop with qgis.org/download/ubuntu#steps

  1. Create Dockerfile

    FROM dorowu/ubuntu-desktop-lxde-vnc:focal
    
    ENV USER=dinos
    ENV HTTP_PASSWORD=go_rawr
    
    RUN apt-get update --fix-missing
    RUN sudo apt-get install -y qgis qgis-plugin-grass
    
    RUN rm -rf /var/lib/apt/lists/*
    RUN rm -r /root/.cache
    
  2. Build (from Dockerfile's directory)

    docker build . --tag qgis_on_ubuntu_emulator < Dockerfile
    

    WIP Note: Still figuring out how to reduce the bloat, but majority is base image

    $  docker image list
    REPOSITORY                                      TAG          IMAGE ID       CREATED          SIZE
    qgis_on_ubuntu_emulator                         latest       61d5b81fbfe9   10 minutes ago   2.3GB
    ubuntu_emulator                                 latest       0cc9e3efcc5d   5 months ago     1.32GB
    
  3. Run (choosing localhost port 12345 because it's tickles my giggles today - aka all the fun port math numbers are busy)

    $ docker run -p 12345:80 qgis_on_ubuntu_emulator
    

    NOTE: example does not include volume/data/package persistence which is desirable, but left as an excercise to the reader

  4. Open browser at http://localhost:12345/

  5. Once Ubuntu machine starts up, will ask you to HTTP authenticate; use username:password pair of dinos:go_rawr (set above)

  6. In Ubuntu, navigate: Start menu > Education > "QGIS Desktop" (or "GRASS GIS 7")

  7. Once it opens, you're ready to click through QGIS updates & then start up a new project 🎉

SCREENSHOT

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment