LinuxCommandLibrary

podman

Run, manage, and build containers

TLDR

List all containers (both running and stopped)

$ podman ps --all
copy

Create a container from an image, with a custom name
$ podman run --name [container_name] [image]
copy

Start or stop an existing container
$ podman [start|stop] [container_name]
copy

Pull an image from a registry (defaults to Docker Hub)
$ podman pull [image]
copy

Display the list of already downloaded images
$ podman images
copy

Open a shell inside an already running container
$ podman exec --interactive --tty [container_name] [sh]
copy

Remove a stopped container
$ podman rm [container_name]
copy

Display the logs of one or more containers and follow log output
$ podman logs --follow [container_name] [container_id]
copy

SYNOPSIS

podman [global options] command [command options]

PARAMETERS

--help
    Display help information.

--version
    Show version information.

--log-level level
    Set the logging level (debug, info, warn, error, fatal, panic).

--root path
    Path to the root directory of the container engine's storage.

--runroot path
    Path to the 'run' directory of the container engine's storage.

--storage-driver driver
    Storage driver to use (overlay, vfs, etc.).

DESCRIPTION

Podman (Pod Manager) is a daemonless, open-source container engine for developing, managing, and running OCI (Open Container Initiative) containers and pods on Linux systems.
It is designed to be a drop-in replacement for Docker in many scenarios, providing a similar command-line interface and functionality without requiring a central daemon process.

Unlike Docker, Podman utilizes a fork/exec model and does not require root privileges by default (rootless mode). This enhances security and simplifies container management.
Podman supports managing containers, pods (groups of containers sharing resources), images, and volumes. It integrates with systemd for container lifecycle management and offers features like image building, network configuration, and resource management.
Podman can pull images from various container registries, including Docker Hub, and interact with container images in a standards-compliant manner.

CAVEATS

Podman does not have a daemon, so features requiring a persistent daemon process (like Docker Swarm) are not directly supported. User namespaces and SELinux are essential for rootless operation.

CONTAINER COMMANDS

Commands to manage containers include: podman create, podman start, podman stop, podman run, podman exec, podman ps, podman rm, podman attach.

IMAGE COMMANDS

Commands to manage images include: podman pull, podman push, podman build, podman images, podman rmi, podman tag.

POD COMMANDS

Commands to manage pods include: podman pod create, podman pod start, podman pod stop, podman pod rm, podman pod ps.

HISTORY

Podman was developed by Red Hat as an alternative to Docker, primarily focusing on daemonless operation and enhanced security.
The first major version was released in 2019.
It has gained significant adoption due to its rootless capabilities and compatibility with OCI standards.

SEE ALSO

docker(1), buildah(1), skopeo(1), systemd(1)

Copied to clipboard