0

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:

  1. Container from Qgis specific docker image and install Postgis
  2. Container from Postgis specific docker image and install Qgis
  3. 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.

3
  • Do not install software inside a running container: it will be lost as soon as the container exits. You should RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install ... in your Dockerfile instead, so the software will be preinstalled in a reusable image. Commented Jul 16 at 14:16
  • Doesn't running the container with ch-run -w make the changes to the container persistent? I also haven't converted the container to .sqfs yet Commented Jul 16 at 14:36
  • Did you try to RUN the apt lines within Dockerfile? Commented Jul 26 at 16:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.