Podman — Daemonless Docker Alternative

Podman is an open-source, OCI-compliant container engine developed by Red Hat. It provides the same command-line syntax as Docker without requiring a background daemon process, licensing fees, or root privileges.
Key Benefits of Podman
- Daemonless Architecture: Directly launches containers via
runc/crun, eliminating single-point-of-failure daemon crashes. - Rootless Security: Runs containers securely without
sudoor root permissions. - Docker CLI Drop-in: Alias
docker=podmanto run existing workflows seamlessly. - Kubernetes YAML Support: Run and generate Kubernetes Pod manifests directly using
podman play kubeandpodman generate kube.
Getting Started on macOS
# 1. Install Podman via Homebrew
brew install podman
# 2. Initialize and boot the Linux virtual machine
podman machine init --cpus 2 --memory 4096 --disk-size 50
podman machine start
# 3. Verify VM status
podman info
Example: Building and Running a Python Flask Container
1. Application Code (app.py)
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return "Hello from Rootless Podman on macOS!"
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
2. Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY app.py .
RUN pip install --no-cache-dir flask
EXPOSE 5000
CMD ["python", "app.py"]
3. Build, Run, and Test
# Build container image
podman build -t myflask:v1 .
# Run container with port forwarding
podman run -d -p 5000:5000 --name myapp myflask:v1
# Test endpoint
curl http://localhost:5000/
# Inspect logs
podman logs -f myapp
Running Minikube with the Podman Driver
Minikube supports running local Kubernetes clusters on Podman with the CRI-O or containerd runtime:
# Start Minikube with Podman driver
minikube start --driver=podman --container-runtime=cri-o
# Configure Podman as the default Minikube driver
minikube config set driver podman
Essential Podman Commands
| Command | Description |
|---|---|
podman ps -a |
List all containers (running and stopped) |
podman run -d -p 8080:80 <image> |
Run a container in detached background mode |
podman exec -it <container> /bin/sh |
Open an interactive shell inside a running container |
podman generate kube <container> |
Generate a Kubernetes Pod YAML manifest from a container |
podman play kube pod.yaml |
Run a Kubernetes Pod manifest directly in Podman |
podman system prune -a |
Remove unused containers, images, and build cache |