podman commands

16 commands, each with a one-line explanation. Click a command to copy it, or its title for details.

Commands 16 shown

  • podman run -d --name web -p 8080:80 nginx:alpine

    Start a detached nginx container without root privileges

    containers

  • podman build -t myapp:latest -f Containerfile .

    Build from a Containerfile (Dockerfile-compatible)

    containers

  • podman generate systemd --new --name web > ~/.config/systemd/user/web.service

    Create a systemd unit to manage the container lifecycle

    containers · systemd

  • podman play kube deployment.yaml

    Run a pod from a Kubernetes manifest (local testing)

    containers · kubectl

  • podman generate kube mypod > pod.yaml

    Generate a Kubernetes-compatible manifest from a running pod

    containers · kubectl

  • podman pod create --name mypod -p 8080:80 && podman run -d --pod mypod nginx:alpine

    Group containers into a pod sharing network namespace

    containers

  • podman image inspect myapp:latest | jq '.[0].RootFS.Layers'

    List filesystem layers of an image

    containers · debug

  • podman ps -a --format '{{.Names}}\t{{.Status}}\t{{.Image}}'

    Show all containers with name, status and image

    containers

  • podman container prune -f

    Non-interactively delete all exited containers

    containers

  • podman login registry.example.com -u myuser

    Authenticate with a container registry

    containers

  • podman generate systemd --new --files --name <name>

    Emit a portable .service that recreates the container on start; note: Quadlet is the modern way

    systemd · gitops

  • podman generate kube <pod> > pod.yaml

    Reverse-engineer a running pod into a K8s manifest for migration to a cluster

    k8s · gitops

  • podman play kube pod.yaml --replace

    Spin up pods/services from a K8s manifest with no cluster; --replace re-applies cleanly

    k8s · troubleshooting

  • podman unshare cat /proc/self/uid_map; cat /etc/subuid

    Inspect the user-namespace uid range backing rootless containers; fix perms via chown inside unshare

    security · rootless · troubleshooting

  • podman auto-update --dry-run && systemctl --user start podman-auto-update

    Pull newer images and restart labeled containers; needs io.containers.autoupdate=registry label

    ci · gitops · security

  • podman system migrate

    Refresh OCI runtime and user-namespace config after a podman/kernel upgrade; fixes stale containers

    troubleshooting · kernel