Summary and Setup

This is a Byte-Sized RSE lesson on containers using the Podman open source container engine, part of the Byte-Sized RSE Series.

Containers have become an essential tool for modern research software development, enabling reproducible computational environments that run consistently across laptops, servers, and high-performance computing systems. In this lesson, you will learn what containers are and how they differ from virtual machines, before gaining hands-on experience with Podman: a free, open source, daemonless container engine. Starting from verifying your installation, you will progress through pulling images from public registries, running and managing containers, working with long-lived services, executing commands inside running containers, and sharing data between your host machine and a container.

Learning Objectives


At the end of this lesson, learners should be able to:

  • Explain what containers are, how they work, and why they are useful for reproducible research software.
  • Describe the key differences between containers and virtual machines.
  • Verify a Podman installation and start a Podman machine on macOS or Windows.
  • Pull container images from public registries and run containers using the Podman command-line interface.
  • Manage the lifecycle of containers, including naming, starting, stopping, and removing them.
  • Run a service container in detached mode, publish ports, and inspect its logs.
  • Execute commands and open interactive shells inside running containers.
  • Mount host directories into containers to share data between the host and the container.
  • Search container registries from the command line and configure registry search on Linux.

Setup


Prerequisite

Skill prerequisites for the practical activity:

  • Ability to navigate filesystem and run commands from within a shell or terminal application

Software prerequisites:

  • Shell or terminal application
  • Podman, for running and managing containers
  • A text editor you are familiar with

Shell

On macOS and Linux, some version of a shell (e.g. bash) with Git will be available by default and no installation is needed.

If you do not have a bash shell installed on your system and require assistance with the installation, you can take a look at the instructions provided by Software Carpentry for installing shell and Git. You’ll also need a GitHub.com account.

Podman

There are detailed instructions about installing podman on the Podman website, but there is further information on installing Podman on Linux, MacOS or Windows at https://www.universe-hpc.ac.uk/resources/byte-sized-rse/podman-info.

We’ve chosen Podman instead of Docker for this training because it is free, open source, and avoids the licensing and subscription considerations associated with Docker Desktop (which is the easiest way to install Docker) in organisational environments, including universities. Additionally, Podman’s command-line interface remains largely compatible with Docker, ensuring that the skills learned transfer easily to the Docker platform.

Please note that Podman and Podman Desktop are two different tools. For this course, we’ll focus on the main podman container engine and its command line interface, not Podman Desktop.

Podman Desktop provides a graphical user interface (GUI) for controlling and managing podman containers, but it can also enable you to manage and work with containers provided by a range of other container platforms via a series of easy to install extensions or plugins. If you install Podman Desktop, this should also install, as part of the installation process, podman itself. However, we recommend just installing podman since that is the only tool required for this session.