PODMAN

Blog
Spread the love

1.Introduction

Podman: The Modern Container Management Tool.

What is Podman?

Podman (short for Pod Manager) is an open-source container management tool designed as an alternative to Docker. Unlike Docker, Podman is daemonless, meaning it does not rely on a background service to manage containers. It provides a secure way to run, manage, and deploy containers and pods.

Why Use Podman?

Podman offers several advantages over Docker:

  • Daemonless Architecture – No root privileges required.
  • Rootless Containers – Improves security by allowing non-root users to manage containers.
  • OCI Compatibility – Works with Open Container Initiative (OCI) images.
  • Docker CLI Compatibility – Most Docker commands work with Podman.
  • Kubernetes Integration – Easily generates Kubernetes YAML files.

2.Installation of Podman

Podman is available for Linux, macOS, and Windows. Below are the installation steps for different operating systems:

For Ubuntu/Debian

For CentOS/RHEL

For macOS (Using Homebrew)

For Windows (Using Winget)

link for download podman: https://podman-desktop.io/downloads/windows

img

img

After installation, verify Podman by running:

img

3.Running Your First Podman Container

Podman follows a similar command structure to Docker. To pull and run a basic container:

To run an NGINX container:

Now, visit http://localhost:8080 to see the running NGINX server.

4.Managing Containers with Podman Command:

Listing Containers

  • Running containers:
  • All containers (including stopped ones):

Stopping and Removing Containers

Removing an Image

Checking System Information

5.Podman vs Docker: Key Differences

Feature Podman Docker
Daemonless Yes No
Rootless Mode Yes No
Uses OCI Images Yes Yes
CLI Compatible Yes Yes
Pod Support Yes No

You can alias Podman to replace Docker commands: alias docker=podman

6.Working with Pods in Podman

Pods in Podman function similarly to Kubernetes pods, allowing multiple containers to share networking and resources.

Creating a Pod

Running a Container Inside a Pod

Listing Pods

Inspecting a Pod

7.Building and Running Custom Images with Podman

Step 1: Create a Dockerfile.

Step 2: Build the Image with Podman

Step 3: Run the Custom Container

8.Podman and Kubernetes Integration

Podman allows easy conversion of container configurations into Kubernetes YAML manifests.

Generating a Kubernetes YAML File

Applying YAML in Kubernetes

9.Running Podman as a Systemd Service

Podman integrates with systemd for automated container management.

Generating a systemd Service for a Podman Container

Enabling and Starting the Service

Basic Podman Commands
Command Description
podman –version Check the installed Podman version
podman info Display system information about Podman
podman –help Show help for Podman commands
Working with Containers
Command Description
podman pull <image> Pull an image from a container registry
podman images View all available images
podman run <image> Run a container from an image
podman run -d <image> Run a container in detached mode
podman run -it <image> bash Run a container interactively with a shell
podman start <container_id> Start a stopped container
podman stop <container_id> Stop a running container
podman restart <container_id> Restart a container
Basic Container Commands
Command Description
podman rm <container_id> Remove a container
podman ps List running containers
podman inspect <container_id> View container details
podman logs <container_id> View container logs
podman exec -it <container_id> /bin/bash Access a running container’s shell
podman stats <container_id> Monitor a container’s resource usage
Working with Images
Command Description
podman search <image> Search for an image in a registry
podman pull <image> Download an image from a registry
podman images List all downloaded images
podman rmi <image> Remove an image
podman tag <image> <new_image> Tag an image with a new name
podman history <image> Show details about an image
Building and Managing Custom Images
Command Description
podman build -t <image> . Build an image from a Dockerfile
podman save <image> > <image>.tar Save an image as a tar file
podman load -i <image>.tar Import an image from a tar file
podman push <image> Push an image to a remote registry
Networking and Ports
Command Description
podman network ls List all available networks
podman network inspect <network> View network details
podman network create <network_name> Create a custom network
podman network rm <network_name> Remove a network
podman run -p <host_port>:<container_port> <image> Map ports between host and container
Working with Pods
Command Description
podman pod ls List all running pods
podman pod inspect <pod_name> Show pod details
podman pod start <pod_name> Start a stopped pod
podman pod stop <pod_name> Stop a running pod
podman pod rm <pod_name> Remove a pod
Podman and Kubernetes
Command Description
podman generate kube <container/pod> Generate a Kubernetes YAML from Podman
podman kube play <kube>.yaml Deploy a Kubernetes YAML in Podman
Systemd and Automation
Command Description
podman generate systemd –name <container> Generate a systemd service for a container
podman user start container <container> Start the systemd-managed container
podman user status container <container> Check the status of the container service
Volumes and Persistent Storage
Command Description
podman volume create <volume_name> Create a new volume
podman volume ls List all volumes
podman volume inspect <volume_name> Show details about a volume
podman run -v <volume_name>:/path/in/container <image> Attach a volume to a container
Security and Rootless Mode
Command Description
podman unshare ls Open a shell in a user namespace (listing the directory as rootless user)
podman run –userns=keep-id <image> Run a container with the same user ID as the host

10. Conculsion

Podman is a secure, daemonless, and rootless container management tool that provides an excellent alternative to Docker. Its Kubernetes integration, pod support, and OCI compatibility make it a powerful choice for containerized applications.

bluethinkinc_blog

bluethinkinc_blog

2025-04-11

0

Leave a Reply

Your email address will not be published. Required fields are marked *

Find More Blogs

PODMAN

Spread the love 1.Introduction Podman: The Modern Container

Running Your Java Program (JAR) 24/7 on AWS EC2 Automatically

Spread the love Introduction Running a Java application

Building a REST API with Spring Boot

Spread the love Introduction REST (Representational State

Custom API to Fetch Customer Data by Customer ID in Spryker

Spread the love Introduction In this blog post, we will

Creating a Custom Module for a Custom Frontend Page in Spryker

Spread the love To create a custom module for a custom

How to create custom module api get category list without access token in Spryker

Spread the love To create a custom API for fetching a

Creating a Custom Glue API in Spryker

Spread the love Spryker’s Glue API is a powerful tool

Get AI Generated 360-Degree View of Account Summary in Dynamics 365 Sales

Spread the love Navigating the demanding landscape of sales

Enhancing Productivity with Dynamics 365: The Power of Session Restore

Spread the love Enhancing Productivity with Dynamics 365:

Salesforce Admin

Spread the love In our last blog, we discussed common

bluethinkinc Blogs