Youssef Ameachaq's Blog

Youssef Ameachaq

Introduction to Podman


Introduction to Podman

What is Podman?

Why Use Podman?

  1. Daemonless: Unlike Docker, Podman doesn’t need a constantly running background service (daemon).
  2. Rootless: It lets you run containers as a regular user (not requiring root/admin), making it safer.
  3. Docker-compatible: Commands are almost identical to Docker, and it can even use Dockerfiles to build containers.

What is a Daemon?

A daemon is a background program or process that runs continuously in a system, often performing tasks or waiting for requests to handle.

Key Characteristics of a Daemon

  1. Background Process: It doesn’t have a graphical interface or terminal window. It works in the background.
  2. Starts Automatically: Many daemons start when the system boots (e.g., a web server daemon).
  3. Always Running: They keep running and wait for requests (like listening for incoming network connections).

Examples of Daemons

Daemon in Containers

Real-Life Analogy


Things You Need to Know to Use Podman

1. Installation

2. Podman CLI

3. Podman vs Docker

4. Pods


Examples

1. Run a Simple Container

podman run --name hello-world-container -d docker.io/library/alpine sleep 1000

Explanation:

2. List All Containers

podman ps

3. Stop and Remove a Container

podman stop hello-world-container
podman rm hello-world-container

4. Build an Image from a Dockerfile

podman build -t my-app .

Explanation:

5. Running Multiple Containers in a Pod

podman pod create --name my-pod
podman run --pod my-pod -d nginx
podman run --pod my-pod -d redis

Explanation:

6. Inspect a Container

podman inspect hello-world-container

7. Export and Import an Image