Introduction to Docker and Podman: Setup

Installation

The training module can be followed using either Docker or Podman. We recommend using Podman as it does not require root privileges to use it out of the box. In addition, Docker has licensing restrictions that may prevent you from using it in certain sites.

The installation of Podman requires sudo privileges. If you don’t have them, check if Podman is already installed on your system with:

podman version

If it’s not available, ask your system administrator to install it for you.

Install Podman on Linux

Podman is available on the official repositories of most Linux distributions. Check the official documentation to find out how to install it on your system.

For example, in Ubuntu, you can install it by running the following command:

# Ubuntu 20.10 and newer
sudo apt-get update
sudo apt-get -y install podman

Install Podman on MacOS

Running Podman or Docker on MacOS requires a virtual machine to run the containers. In the case of Podman, it provides an installer at https://podman.io/. Download the .dmg package for MacOS, extract it, and execute Podman Desktop.

The first time that Podman Desktop is executed it will be required to install Podman and a Podman machine to execute the containers. Click “Set up” and follow the instructions.

Install Podman on Windows

Podman provides instructions to install it on Windows at the GitHub repository.

Post Installation

Check that you can run Podman with the following command:

podman run hello-world

Installing Docker

If you prefer to use Docker (check with the IT department of your institution before using Docker!), follow the official instructions for Linux, Mac, or Windows.

If you are using Linux, then please also follow these post installation instructions.

Across the tutorial, just replace podman by docker in the commands and you should be good to go.

Optional: Fetch images in advance

Once you’ve got Podman up and running, do the following docker image pulls in advance to save time during the tutorial:

podman pull docker.io/almalinux:9
podman pull docker.io/debian:buster-slim
podman pull docker.io/python:2.7-slim
podman pull docker.io/python:3.7-slim

Analysis Code

Later in this tutorial, you will be asked to work with a simple analysis that utilizes the CMS OpenData to search for Higgs to 2 tau leptons. The full analysis itself can be found here — and there is a dedicated set of training lessons (videos available).

It is best if you work through these lessons before the tutorial on Containers, but not mandatory.