Building and Running Containers
Master building custom container images and running containers with Podman, including managing port mappings and running interactive containers.
About This Lab
In this hands-on lab, you will learn how to build custom container images, run containers from those images, and manage them using Podman. Podman is a powerful, daemon-less container engine that provides an alternative to Docker, allowing you to create and manage containers with greater flexibility and security. This lab will guide you through the process of creating custom images, running containers, and verifying your containerized applications.
What You Will Learn
This lab will guide you through:
- Installing Podman using the
dnfpackage manager and verifying the installation. - Creating a custom container image using a
Dockerfileand adding dependencies like Python and curl. - Writing a custom entry point script for your container.
- Building the custom image using the
podman buildcommand and running containers from the custom image. - Running containers in both detached and interactive modes.
- Accessing a running container to install additional tools and verify its functionality.
- Exposing containerized services to the host machine using port mapping.
Why Learn Podman for Container Management?
As containers continue to play a significant role in modern application development and deployment, learning how to build and manage containers is an essential skill for system administrators, developers, and DevOps engineers. Podman offers a lightweight, secure alternative to Docker, with the added benefit of being daemon-less. This allows greater flexibility and control over your containers without requiring a central service. Understanding how to build custom images and manage containers with Podman is crucial for anyone involved in containerization, whether on a local machine or in production environments.
Who Should Take This Lab?
This lab is ideal for:
- Beginners who want to learn about building and running containers with Podman.
- Linux system administrators looking to manage containers in a secure, daemon-less environment.
- Developers and DevOps professionals wanting to deepen their understanding of containerized application workflows.
- Students preparing for certifications like Red Hat Certified System Administrator.
Prerequisites
Before starting this lab, ensure you have:
- Basic knowledge of Linux command-line operations.
Lab Highlights
Key steps you will perform in this lab include:
- Installing Podman and verifying the installation.
- Creating a custom
Dockerfileto define a container image with dependencies and a custom entry point script. - Building and tagging the custom image using the
podman buildcommand. - Running the custom container image and interacting with it using Podman commands.
- Running an
httpdcontainer in detached mode, exposing it to the host machine via port mapping. - Verifying the functionality of the containerized web server from both inside and outside the container.
This lab will give you hands-on experience with Podman’s container lifecycle, including image building, running containers, and managing ports, all of which are critical for working in modern cloud-native environments.
-
RHCSA Preparation Course
-
FREE Labs
-
Red Hat Administration (RH124)Access Linux File SystemManage Files using CLICreate, View, and Edit Text FilesManage Local Users and GroupsControl Access to FilesMonitor and Manage ProcessesControl Services and DaemonsConfigure and Secure SSHAnalyze and Store LogsArchive and Transfer FilesInstall and Update SoftwareManage NetworkingAnalyze Servers
-
Red Hat Administration (RH134)Improve Command Line ProductivitySchedule Future TasksTune System PerformanceControlling Access to Files with ACLManaging SELinux SecurityManage Basic StorageManage Logical VolumeImplement Advanced Storage FeaturesAccess Network Attached StorageManage Network Security (Firewall)Run ContainersFlatpak Application ManagementSystemd TimersSELinux ManagementMount FileSystems Using UUIDAnalyze and Preserve System LogsManage Containers with QuadletsAutoFS and NFS Client MountsTime Synchronization with ChronyManage System Boot Targets
-
Pre-Exam Practice
-
Labs Beyond SyllabusBasic Command Line ToolsMounting Filesystem and Creating LinksCommand Line Text ProcessingIntroduction to Shell ScriptsIntermediate Shell ScriptingAdvanced Shell ScriptingSELinux BasicsSELinux Policy ManagementSELinux TroubleshootingPodman BasicsBuilding and Running ContainersPodman NetworkingLVM ManagementMultiple Logical VolumesLVM Disaster Recovery
-
Certificate Of Completion
-
RHCSA Mock Exam