Podman RHEL 7 Deployment and Architecture

Podman, short for pod manager, is an open source tool engineered for the development, management, and execution of containers. Developed by Red Hat engineers in collaboration with the broader open source community, Podman manages the entire container ecosystem through the utilization of the libpod library. This tool is designed to find, run, build, share, and deploy applications using Open Containers Initiative (OCI) Containers and Container Images. In the evolving landscape of containerization, Podman has emerged as a viable alternative to Docker, particularly since updates to Docker's licensing for large business organizations. For engineers and administrators accustomed to the Docker container engine, transitioning to Podman involves minimal friction, as the majority of the functionality is designed to be almost similar.

The architecture of Podman is fundamentally different from traditional container engines due to its daemonless nature. A daemonless architecture means there is no persistent background process running as root that remains idle while waiting for instructions. In contrast, Podman starts containers directly through the OCI runtime and conmon. This elimination of the daemon simplifies management and significantly enhances security by default, as it removes a single point of failure and a high-privileged process that could be exploited. Podman creates and supports OCI containers, ensuring that the runtime and formats meet rigorous industry standards.

Central to Podman's capabilities is the concept of Pods. Pods are organized groups of containers that run in tandem and share the same resources, a design philosophy closely mirrored after Kubernetes pods. Each pod is composed of one infra container and any number of regular containers. The infra container is critical as it keeps the pod running and maintains user namespaces, which effectively isolate containers from the host system. Podman manages these pods via a command-line interface (CLI) and the libpod library, which provides the necessary application programming interfaces (APIs) for managing containers, pods, container images, and volumes.

Core Architecture and Tooling Integration

Podman does not operate in isolation but is part of a broader ecosystem of container tools designed to provide flexibility and customization for developers. While Podman handles the management and running of containers, accompanying tools like Buildah and Skopeo allow for deeper customization of container environments. Buildah provides more advanced building capabilities than the standard Podman build process, allowing developers to create images with greater precision. Furthermore, for those who prefer a graphical user interface (GUI) over the command line, Podman Desktop is available for use in local environments.

The relationship between the user, the CLI, and the container process is direct. In a Podman environment, the User interacts with the Podman CLI, which then interacts directly with the Container Process. This is fundamentally different from the Docker model, where the User interacts with the Docker CLI, which must then communicate with the Docker Daemon (running as root), which in turn manages the Container Process. By removing the daemon, Podman reduces the complexity of the communication stack and minimizes the security risks associated with root-privileged background processes.

Installation Prerequisites for RHEL 7

Before attempting to install Podman on a Red Hat Enterprise Linux (RHEL) 7 or CentOS 7 server, certain environmental prerequisites must be met to ensure a successful deployment. These requirements ensure that the system has the necessary tools and permissions to handle the installation and subsequent container operations.

  • A running RHEL/CentOS 7 server.
  • Availability of the yum or dnf utility on the server for package management.
  • Sudo or root access to execute privileged commands required for system-level installations.

The presence of the yum utility is mandatory for RHEL 7, as it serves as the primary mechanism for resolving dependencies and installing the Podman package and its associated libraries. Having root or sudo access is critical because the installation involves modifying system directories and installing packages that affect the global state of the operating system.

Step-by-Step Installation on RHEL 7

For users operating on RHEL 7 or CentOS 7, Podman is made available through the default Extras repository. This allows for a direct installation process without the need for complex external repository configurations.

The first step in the installation process is to ensure the server is fully updated. This is achieved by downloading and installing all latest available updates from the enabled repositories. This step prevents version conflicts and ensures that the kernel and system libraries are compatible with the Podman package. The command used for this update is:

yum update

Once the server is updated, the installation of Podman can proceed. Because Podman is available in the Extras repository for RHEL 7, it can be installed directly using the following command:

yum install podman

During the execution of this command, the system resolves a variety of dependencies that are essential for Podman's operation. These dependencies include:

  • slirp4netns (version >= 0.4.0-1): Used for unprivileged networking.
  • runc (version >= 1.0.0-57): The OCI runtime that actually spawns and runs the containers.
  • containers-common (version >= 0.1.29-3): Common configuration and data files for container tools.
  • containernetworking-plugins (version >= 0.8.1-1): Plugins that handle the networking for the containers.
  • nftables: Used for network filtering and firewall management.
  • fuse-overlayfs: Provides an overlay filesystem in user space.
  • container-selinux: Provides SELinux policies for container isolation.
  • conmon: A container monitor that manages the lifecycle of the container process.

The installation of these dependencies is handled automatically by the yum package manager. For instance, the installation process may involve the installation of the epel-release package to ensure access to additional community-supported software.

Post-Installation Verification

After the installation process is complete, it is imperative to verify that Podman is correctly installed and functioning as expected. Verification is performed in two stages: version checking and system information analysis.

To check the currently installed version of Podman, the following command is used:

podman --version

A successful installation on a RHEL 7 system will return the version number, such as podman version 1.6.4. This confirms that the binary is in the system path and is executable.

To obtain a comprehensive overview of the Podman system, including its configuration, storage, and runtime environment, the following command is utilized:

podman info

The podman info command provides detailed technical data regarding the host system and how Podman is interacting with it. This is essential for troubleshooting and for ensuring that the environment is optimized for the specific workloads being deployed.

Advanced Deployment: Building Podman from Source

In scenarios where the version provided in the official RHEL 7 repositories is insufficient, or where specific custom features are required, Podman can be compiled from the source code. This process requires the installation of the Go programming language and several system-level dependencies.

The initial step is to clone the official Podman repository from GitHub:

git clone https://github.com/containers/podman/

Once cloned, the user must navigate into the directory:

cd podman

The compilation process is managed through the make utility. Podman supports optional build tags that allow the user to enable or disable specific features during the build process. For a standard build with security features enabled, the following command is used:

make BUILDTAGS="selinux seccomp" PREFIX=/usr

After the build is complete, the installation is performed using the following command:

sudo env PATH=$PATH make install PREFIX=/usr

If a user wishes to build Podman without seccomp or selinux support, the BUILDTAGS variable can be left empty:

make BUILDTAGS=""

sudo make install

Build Tags and Feature Dependencies

The use of build tags allows for the tailoring of the Podman binary to the specific capabilities of the host operating system. The following table details the build tags, the features they enable, and the dependencies they require.

Build Tag Feature Dependency
apparmor apparmor support libapparmor
cni CNI networking None
excludegraphdriverbtrfs exclude btrfs libbtrfs
excludegraphdriverdevicemapper exclude device-mapper libdm
libdmnodeferred_remove exclude deferred removal in libdm libdm
seccomp syscall filtering libseccomp
selinux selinux process and mount labeling None
systemd journald logging libsystemd

It is important to note that Podman does not officially support device-mapper. Consequently, the exclude_graphdriver_devicemapper tag is mandatory during the build process. Additionally, for those building on RHEL 8, btrfs support must be excluded due to its removal, requiring the tags btrfs_noversion and exclude_graphdriver_btrfs.

Dependency Management and Vendoring

Podman utilizes Go modules for dependency management. This ensures that the project can maintain consistent versions of its dependencies, reducing the risk of "dependency hell" and ensuring that the compiled binary is stable across different environments. Vendoring allows the project to include the source code of its dependencies within its own repository, which facilitates offline builds and ensures that the build process is not disrupted by the removal of external libraries from the internet.

Comparative Analysis: Podman vs Docker

The transition from Docker to Podman is often motivated by the structural differences in how the two engines handle process management and security.

  • Daemon Status: Docker relies on a persistent root-privileged daemon. Podman is daemonless.
  • Security Model: Docker's daemon represents a single point of failure and a potential security vulnerability. Podman's architecture minimizes this risk by launching containers directly.
  • Privilege Requirements: Podman is designed to operate without root requirements, allowing for rootless containers that enhance the security posture of the host.
  • OCI Compatibility: Both Podman and Docker are compatible with Open Container Initiative (OCI) standards, meaning that images created in Docker can generally be run in Podman and vice versa.

Registry Configuration

Once Podman is installed and verified, the system must be configured to know where to pull container images from. Podman manages this via a configuration file located at /etc/containers/registries.conf. This file defines the search registries, allowing the user to specify whether images should be pulled from Red Hat's official registry, Docker Hub, or a private internal registry. Proper configuration of this file is essential for maintaining a secure and efficient image pipeline, as it prevents the system from attempting to pull images from untrusted or unauthorized sources.

Technical Analysis of the RHEL 7 Container Environment

The deployment of Podman on RHEL 7 marks a significant shift in how containerized workloads are handled on legacy Enterprise Linux systems. The integration of the container-tools module is a pivotal development. In RHEL 8, this module bundles Podman, Buildah, and Skopeo together. While RHEL 7 handles these as separate installations or through the Extras repository, the operational goal remains the same: providing a complete toolset for the container lifecycle.

The impact of the daemonless architecture on RHEL 7 is particularly profound. By utilizing conmon to monitor the container, Podman ensures that the container remains isolated and manageable without needing a central authority. The use of slirp4netns further enables the execution of containers in a rootless mode, meaning the user does not need to be root to start a container. This is a critical security advancement, as it limits the potential impact of a container escape vulnerability.

The use of fuse-overlayfs on RHEL 7 allows users to leverage overlay filesystems without requiring root privileges, which was previously a significant limitation in early container iterations. When combined with container-selinux, Podman creates a multi-layered security boundary that protects the host kernel from the containerized processes.

Conclusion

Podman represents a fundamental evolution in container orchestration for the RHEL ecosystem. By replacing the centralized daemon model with a decentralized, OCI-compliant architecture, it addresses critical security and stability concerns. For RHEL 7 users, the availability of Podman via the Extras repository provides an accessible path to modern containerization, allowing for the deployment of pods that share resources and maintain isolation through infra containers. Whether installed via the standard package manager or compiled from source with specific build tags like seccomp and selinux, Podman provides a robust, secure, and scalable alternative to traditional container engines. The integration of the libpod library and accompanying tools like Buildah and Skopeo ensures that users have a comprehensive suite for managing the entire container lifecycle, from image creation to deployment and monitoring.

Sources

  1. CyberIT Hub
  2. OneUptime
  3. Podman Official Documentation
  4. Red Hat

Related Posts