Skip to content

Podman - A Quick Start Guide

Here is a quick overview to get you started with using Podman on SuperCloud. The following topics will be covered:

  • Pulling images
  • Listing images
  • Saving images
  • Loading images
  • Running images
  • Sharing images

Example use of the commands will be illustrated with the "Hello World" container image. For complete Podman documentation, please go here.

Pulling Images

1. It is recommended to pull an image on a download node. Request an interactive session on a download node.

user1@login-1:~$ LLsub -i -p download

2. Set the image directory by setting the XDG_DATA_HOME environment variable to the TMPDIR variable. The Slurm sets TMPDIR to point at the local disk area for temporary space.

user1@dtn-2:~$ export XDG_DATA_HOME=$TMPDIR

3. Pull the image from the repo.

General syntax : podman pull Image_name

user1@dtn-2:~$ podman pull hello-world

Listing Images

The podman images command is used to list the images in the image directory user1@dtn-2:~$ podman images

Saving Images

General syntax : podman save -o Image_name.tar Repository:Tag

user1@dtn-2:~$ podman save -o hello_world.tar docker.io/library/hello-world:latest

After saving the image as tar file, you can exit the download node. Upon exiting, the image directory will be deleted.

Loading Images

The container image can be loaded from the tar file. The following steps show how to load the hello-world image on a compute node.

General syntax : podman load -i image_name.tar

Request an interactive session.

user1@login-1:~$ LLsub -i

Set the image directory with XDG_DATA_HOME environment variable.

user1@c-3-3-2:~$ export XDG_DATA_HOME=$TMPDIR

Load the image.

user1@c-3-3-2:~$ podman load -i hello_world.tar

Running Images

After loading the image, the container can be run on the compute node. Assuming you have an interactive session and set the iamge directory, you can use the podman run command to run the image.

General syntax : podman run Imagename

user1@c-3-3-2:~$ podman run hello-world

Note: We have installed the Nvidia container toolkit on GPU nodes. In order to access GPUs from the container, please add the "--device nvidia.com/gpu=all" option to the podman command.

Sharing Images

The saved image tar file can be shared with others through a shared group directory.