Howto use docker at D-MATH

To use docker at D-MATH is to use podman -> https://podman.io/

With podman you can use all docker commands just write podman instead of docker in the command, all the parameter stay the same.

With podman we are able to provide a possibility that a user without administrative rights can download and run docker images.

Example 1

The following example will run the latest docker image of alpine linux (https://hub.docker.com/_/alpine).

podman run -ti -v $(pwd):/home/test alpine:latest

The parameter

  • -v $(pwd):/home/test

is very helpful, this will add the current folder you are in now, to the container at /home/test. If you have seLinux activated you need to add a Z:

  • -v $(pwd):/home/test:Z

Example 2

The following example shows howto run a more complicated docker image named fenics and transfer files.

First open a terminal and go into the folder which you want to have accessable in the docker image.

mkdir -p ~/Documents/mydata
cd ~/Documents/mydata

Now run the container with the following parameters:

podman run -ti -p 127.0.0.1:8000:8000 -v $(pwd):/home/fenics/shared -w /home/fenics/shared quay.io/fenicsproject/stable:current

This will connect you to the container.

But the docker image of the fenicsproject will log you in a user fenics, this user will not have access to the data in ~/Documents/mydata.

With podman the user root in the container will have access to your files.

So you need to become root inside the container to have access:

sudo su -

Author

Posted on
in Computing,Linux

PROTECT YOUR BRAINWORK.

Recent Posts

Trending

Categories

Recent Posts