The RUN directive executes a command in an intermediate container during image construction.
The RUN instruction executes a command inside a temporary container during image construction. Podman applies the same security constraints used by podman run, then commits the resulting changes for the next build step. section 2.3.1
Install and clean a package
RUN yum -y update; yum -y install procps-ng; yum -y clean all installs the ps command, updates the base image, and removes package-manager cruft from the resulting image. section 2.3.1
How Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more covers it
How deep it goes
Explains build-container execution and committed layers, but gives only one command example rather than detailed syntax variations.
Examples
Uses yum to update packages, install procps-ng, and clean package metadata so the image contains ps with less cruft.
What it assumes
Assumes a base image and basic package-manager commands, while establishing that build commands execute inside a container.
What you can do after
Apply it via Podman to install packages and modify an image while preserving changes for subsequent build steps.
How it connects
Connects Containerfiles to base images, image layers, package management, and CMD.
image layerproduces · An image layer is an immutable filesystem change set that contributes to a layered container image and may be stored, cached, or shared independently.
cmd directivecontrasts with · The Dockerfile CMD instruction specifies the default command or arguments executed when a container starts, unless overridden at runtime.
code compilationimplements · Code compilation is the translation of source code or another formal representation into an executable, intermediate, or lower-level representation.
dependencyuses · A software dependency is a component, resource, or prerequisite on which another software component or operation relies to function or proceed.
FluentBitconfigures · Fluent Bit is a lightweight, open-source telemetry agent for collecting, processing, enriching, and forwarding logs and other event data.
Dockerfilepart of · A Dockerfile is a text file containing declarative instructions for building a container image and specifying its contents and runtime metadata.
This explainer was generated by Manning's knowledge graph from the text of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more. The section links point to the parts of the book it draws on.