Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Containerization and Virtualization

This category covers container runtimes, container image tools, and other virtualization-related tools.

Container Runtimes

Podman

Podman is a modern, daemonless container engine that provides a Docker-compatible command-line interface, making it easy for users familiar with Docker to transition.

Installation

To install Podman, add the following line to configuration.nix:

virtualisation.podman.enable = true;

Verified Usage

podman run

podman run runs a command in a new container.

# Start a container, execute a command, and then exit
podman run --name=c1 docker.io/library/alpine ls /etc

# Start a container and attach to an interactive shell
podman run -it docker.io/library/alpine
podman image

podman image manages local images.

# List downloaded images
podman image ls
podman ps

podman ps lists containers.

# Show the status of all containers (including exited ones)
podman ps -a
podman rm

podman rm removes one or more containers.

# Remove a container named foo
podman rm foo

Container Image Tools

Skopeo

Skopeo inspects and copies container images without a daemon.

Installation

environment.systemPackages = [ pkgs.skopeo ];

Verified Usage

# Inspect a remote image
skopeo inspect docker://docker.io/library/alpine:latest

# List all tags for a repository
skopeo list-tags docker://docker.io/library/alpine