Docker revolutionized software development and deployment by popularizing container technology. However, Docker requires root privileges to build and run containers. This poses security risks and limits who can use Docker. Therefore, in most of the HPC environment Docker is not allowed.
Rootless Podman provides many benefits of Docker without requiring root:
Podman does not need a background daemon or root access. Containers run as non-root users. This improves security.
Podman uses user namespaces to provide an isolated container environment for non-root users. Processes inside containers cannot see or affect the host system.
Rootless Podman allows non-privileged users to build, run, and share containers easily, without involving IT/ops.
Podman has a compatible CLI with Docker. Most Docker knowledge transfers to Podman.
Podman can use Docker images and registries like Docker Hub. Image support is compatible.
In summary, Rootless Podman provides a user-friendly container platform for developers, analysts, and engineers. It improves security by eliminating the need for root privileges. Podman makes it easy for non-privileged users to benefit from container technology.
podman
command as docker
could be made.alias docker='podman'
podman images
registry.redhat.io
. Please add docker.io
if you want to pull from Docker Hub.# Pull from Docker Hub
podman pull docker.io/ubuntu:22.04
# Pull from your personal repo of BioHPC GitLab
podman pull git.biohpc.swmed.edu:5050/astrocyte/container/r:4.2.2
# Run the image directly (Better know the default command of the image before running it.)
podman run docker.io/library/ubuntu:22.04
# Run the image directly and remove the containers after finished.
podman run --rm docker.io/library/ubuntu:22.04
# Run the image interactively (Go inside the image) and remove the containers after finished.
podman run --rm -it docker.io/library/ubuntu:22.04 /bin/bash
# Check running containers
podman ps
# Check all containers (including stopped ones)
podman ps -a
# Remove the container with an ID as b61f5b266e6f
podman rm b61f5b266e6f
# Force to remove the container with an ID as b61f5b266e6f
podman rm -f b61f5b266e6f
# Remove a image
podman rmi docker.io/library/ubuntu:22.04
# Force to remove a image
podman rmi -f docker.io/library/ubuntu:22.04
# Save an image to tar
podman save docker.io/library/ubuntu:latest > ubuntu_latest.tar
# Remove the image for testing
podman rmi docker.io/library/ubuntu:latest
# Load the archived image
podman load < ubuntu_latest.tar
# Check the images again
podman images
module load singularity/3.9.9
# Convert docker archive to Singularity image
singularity build ubuntu_latest.sif docker-archive://ubuntu_latest.tar
# Run with Singularity
singularity exec ubuntu_latest.sif /bin/bash
In order to do this, you need to create an Access Tokens from your BioHPC GitLab settings and log in with podman first. Here are the steps:
Preferences
from the dropdown of your personal icon at the top right cornerAccess Tokens
Token name
, Expiration date
, Select a role
, and Select scopes
. To be able to push images, you need at least have the write_registry
permission selected.Create personal access token
button.Settings
–> Access Tokens
(in the left-hand menu).Token name
, Expiration date
, Select a role
, and Select scopes
. To be able to push images, you need at least have the write_registry
permission selected.Create project access token
button.podman login git.biohpc.swmed.edu:5050
# Provide the "Token name" as your username
# Provide the "Token" as your password
# Tag the image with private BioHPC GitLab repo
podman tag docker.io/library/ubuntu:22.04 git.biohpc.swmed.edu:5050/astrocyte/container/ubuntu:22.04
podman push git.biohpc.swmed.edu:5050/astrocyte/container/ubuntu:22.04
podman pull git.biohpc.swmed.edu:5050/astrocyte/container/ubuntu:22.04
module load singularity/3.9.9
singularity pull docker://git.biohpc.swmed.edu:5050/astrocyte/container/ubuntu:22.04
Podman is now available on the BioHPC cluster after the latest update to RHEL 7.9. This guide will demonstrate how to use rootless Podman under your user account. An important thing to note is that because it is rootless, everything Podman creates - including images and containers - is stored in a temporary directory and removed when you log out. So remember to push your images to a container registry like the BioHPC GitLab ((git.biohpc.swmed.edu:5050)) or Docker Hub after building to avoid losing them.
BioHPC Portal
–> Cloud Services
–>Web Visualization
at here (https://portal.biohpc.swmed.edu/intranet/terminal/webgui/)
# E.g. run the ssh command from Linux to log in Nucleus
ssh YOUR_USER_NAME@nucleus.biohpc.swmed.edu
super
partition. You can replace super
with any partition you’d like to use, but super
is quick.srun -p super -N 1 --pty bash
podman
commands.Similar to Option 2, the user could create a sbatch script and submit the job to SLURM.
# E.g. run the ssh command from Linux to log in Nucleus
ssh YOUR_USER_NAME@nucleus.biohpc.swmed.edu
#!/bin/bash
#
#SBATCH --job-name Podman
#SBATCH -p super
#SBATCH -N 1
#SBATCH -t 0-2:0:0
#SBATCH -o job_%j.out
#SBATCH -e job_%j.err
podman images
podman pull ubuntu
podman run --rm -it docker.io/library/ubuntu:latest cat /etc/os-release
sbatch YOUR_SBATCH_SCRIPT