liveBook · Manning

Chapter 9: Podman as a service

What you will learn in chapter 9 of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more

This chapter introduces Podman’s Linux-only service as a way for programs, Docker-based tools, and remote Podman commands to manage containers.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This chapter introduces Podman’s Linux-only service as a way for programs, Docker-based tools, and remote Podman commands to manage containers.

Key terms: Podman service, REST API, rootless, rootful, docker-py, podman-py, docker-compose, Docker daemon, --remote, Podman connections

9.1 Introducing the Podman service

This section introduces Podman’s API service, where it listens, how it differs from a centralized daemon, and how it is secured and managed.

Key terms: REST API, podman system service, URI, UNIX domain socket, TCP socket, rootful, Podman service, centralized daemon, datastore, authorization

9.1.1 Systemd services

This section explains how systemd socket activation runs the Podman API service on demand and how to start and test the rootless socket.

Key terms: systemd socket activation, podman system service, UNIX domain socket, podman.socket, rootful Podman, rootless Podman, --user, podman.sock, XDG_RUNTIME_DIR, curl

9.2 Podman-supported APIs

This section explains Podman’s two REST APIs, when to use each, and how their endpoints behave differently over the same service socket.

Key terms: compatibility API, Docker API, Libpod API, Swarm APIs, curl, jq, libpod field, JSON, pods, Not Found

9.3 Python libraries for interacting with Podman

This section introduces two Python libraries for interacting with Podman and identifies the API each uses.

Key terms: docker-py, podman-py, compatibility API, Libpod API

9.3.1 Using docker-py with the Podman API

This section shows how existing docker-py scripts can use Podman’s Docker-compatible API by connecting to the Podman service socket.

Key terms: docker-py, Podman compat API, podman-py, DockerClient, podman.sock, DOCKER_HOST, docker.from_env(), python-docker, podman-docker, docker.sock

9.3.2 Using podman-py with the Podman API

This section shows how podman-py connects Python programs to the Podman service and uses the Libpod API to access images and pods.

Key terms: podman-py, docker-py, Libpod API, Podman service, podman.sock, rootless socket, /run/user/$UID/podman/podman.sock, /run/podman/podman.sock, python-podman, podman-images.py

9.3.3 Which Python library should you use?

This section compares docker-py and podman-py to help readers choose a Python library for Podman, then connects those libraries to higher-level container tools.

Key terms: docker-py, podman-py, rootful, rootless, DOCKER_HOST, podman.socket, docker-compose

9.4 Using docker-compose with the Podman service

This section shows how docker-compose uses the Podman service to launch and manage containers defined in a Compose YAML file.

Key terms: docker-compose, compose, Kubernetes YAML, compose YAML, docker-py, Docker REST API, compat REST API, rootless, rootful, systemd socket-activated service

9.5 podman - -remote

This section introduces Podman’s remote client mode, which manages containers through a Podman service rather than running them directly, and explains how that mode supports non-Linux clients.

Key terms: podman --remote, socket-activated Podman service, REST API, podman-remote, client mode, VM

9.5.1 Local connections

This section shows how podman --remote connects to the local Podman service and explains why that mode is mainly useful for API testing.

Key terms: podman --remote, podman.socket, local connection, Podman client, Podman server, local connections, API, continuous integration (CI) systems

9.5.2 Remote connections

This section explains how podman --remote reaches a Podman service over SSH and how to prepare the remote server for rootless connections.

Key terms: podman --remote, SSH, Podman service, systemd socket activation, REST API, SSHD daemon, podman.sock, rootless Podman, enable-linger, rootful podman service

9.5.3 Setting up SSH on the client machine

This section explains how to prepare SSH authentication on the client and server before configuring a remote Podman connection.

Key terms: SSH, SSH key pair, ssh-copy-id, id_ed25519.pub, authorized_keys

9.5.4 Configuring a connection

This section shows how to save an SSH connection to a remote Podman socket, then select and test that connection for remote commands.

Key terms: podman system connection add, SSH URL, Podman socket, --identity, SSH keys, podman system connection list, default connection, podman info, --connection, -c

9.6 Summary

The summary recaps how Podman’s service supports Docker-compatible and Podman-native clients, Compose, and remote management over SSH.

Concepts explained in this chapter

← Chapter 8: Working with Kubernetes Chapter 10: Security container isolation →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.