podman
16 commands
16 shown
Run container rootless
Start a detached nginx container without root privileges
podman run -d --name web -p 8080:80 nginx:alpine
Build image
Build from a Containerfile (Dockerfile-compatible)
podman build -t myapp:latest -f Containerfile .
Generate systemd unit
Create a systemd unit to manage the container lifecycle
podman generate systemd --new --name web > ~/.config/systemd/user/web.service
Play Kubernetes YAML
Run a pod from a Kubernetes manifest (local testing)
podman play kube deployment.yaml
Export pod as Kubernetes YAML
Generate a Kubernetes-compatible manifest from a running pod
podman generate kube mypod > pod.yaml
Create and use a pod
Group containers into a pod sharing network namespace
podman pod create --name mypod -p 8080:80 && podman run -d --pod mypod nginx:alpine
Inspect image layers
List filesystem layers of an image
podman image inspect myapp:latest | jq '.[0].RootFS.Layers'
List all containers including stopped
Show all containers with name, status and image
podman ps -a --format '{{.Names}}\t{{.Status}}\t{{.Image}}'
Remove all stopped containers
Non-interactively delete all exited containers
podman container prune -f
Login to registry
Authenticate with a container registry
podman login registry.example.com -u myuser
Container as systemd unit
Emit a portable .service that recreates the container on start; note: Quadlet is the modern way
podman generate systemd --new --files --name <name>
Export pod to Kubernetes YAML
Reverse-engineer a running pod into a K8s manifest for migration to a cluster
podman generate kube <pod> > pod.yaml
Run Kubernetes YAML locally
Spin up pods/services from a K8s manifest with no cluster; --replace re-applies cleanly
podman play kube pod.yaml --replace
Rootless port/uid mapping debug
Inspect the user-namespace uid range backing rootless containers; fix perms via chown inside unshare
podman unshare cat /proc/self/uid_map; cat /etc/subuid
Auto-update from registry
Pull newer images and restart labeled containers; needs io.containers.autoupdate=registry label
podman auto-update --dry-run && systemctl --user start podman-auto-update
Migrate storage after upgrade
Refresh OCI runtime and user-namespace config after a podman/kernel upgrade; fixes stale containers
podman system migrate
no commands match