I need to migrate my work for geospatial processing (using mainly qgis processing and postgis functions from python scripts) to a HPC cluster. As neither qgis nor postgis are installed on the HPC I figured I need to setup those two in a container. For building and launching the containers I am limited to charliecloud as docker is not available on the HPC. Regarding containers I am an absolute beginner.
So far I have tried three approaches:
- Container from Qgis specific docker image and install Postgis
- Container from Postgis specific docker image and install Qgis
- Basic Ubuntu container and install Qgis and Postgis
Option 1 and 2 did not work as the very specific docker images are not suited to run other applications. Option 3 works fine for qgis but when I try to install postgis using apt-get install -y postgresql I get the error messages:
debconf: delaying package configuration, since apt-utils is not installed
dpkg: error: requested operation requires superuser privilege
E: Sub-process /usr/bin/dpkg returned an error code (2)
running the same command with sudo gives the following messages:
sudo: /etc/sudo.conf is owned by uid 4288686, should be 0
sudo: The "no new privileges" flag is set, which prevents sudo from running as root.
sudo: If sudo is running in a container, you may need to adjust the container configuration to disable the flag.
I did some research on the "no new privileges" flag but only found solutions for docker, not for charliecloud.
I used a very basic dockerfile for the setup of the ubuntu container as I wanted to do the installations of qgis and postgis myself inside the container to be better able to trace the progress and potential errors.
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
RUN locale-gen en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
RUN mkdir -p /dss /lrz /gpfs
The container was built using ch-image build --force -t image_name -f Dockerfile /path
I have installed postgis and qgis inside the container using
apt-get update
apt-get install -y qgis
apt-get update
apt-get install -y postgresql
Another option I was considering is setting up two containers, one specific for qgis and one specific for postgis. After doing some research I could just not figure out how to get one container so access the other using charliecloud. There is a lot of information available on using docker, but I just can't use it.
My prefered option is the setup of qgis and postgis within one container. As I'm a beginner with containers I'm open to any other suggestions and hints aswell.
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install ...in your Dockerfile instead, so the software will be preinstalled in a reusable image.ch-run -wmake the changes to the container persistent? I also haven't converted the container to .sqfs yetRUNtheaptlines within Dockerfile?