Podman#
podman (pod manager)
- Podman
- Building, running, and managing containers | Red Hat Enterprise Linux | 9 | Red Hat Documentation
Common podman commands and paths:#
podman build -t imageName -f ContainerFile . # Build an image from a ContainerFile
podman exec -it runningContainer /bin/bash # Attach to a running container and execute a bash shell to use to run commands
podman login registry.domain.tld # Login to a registry
podman logs container # Review logs from a container
podman info # Get system info about podman like registries
podman inspect imageName # Inspect a local image
skopeo inspect docker://registry/namespace/image # Inspect a remote image
podman ps # List running images
podman ps -a # List all images running or not
podman pull registry/namespace/image # "Pull" an image from a registry
podman run # Run an image, will also attempt to pull the image if it isn't already
podman run -dt imagName # Run an image "detached" with a "tty"
podman run -it imageName # Run an image and attach to the tty, only useful if container runs a shell
podman run -it imageName /bin/sh # Run an image, attach to a tty running /bin/sh. More useful...
podman run -d -p 8080:80 nginx # Run an image with port 8080 forwarded to 80 on the container
podman run -d -e VARIABLE=value image # Run an image with an environment variable
podman search imageName # Search for image with "imageName" in the configured registries
/etc/containers/registries.conf # Default registries config
How do I get a list of currently configured registries?
podman info | grep -A5 ^registries:
Rootful vs Rootless#
Containers can have root privs or not have. Rootless is better for security.
How does rootless Podman work? | Opensource.com
Podman vs. Docker#
Containers can be run by ordinary users that do not need any elevated privileges. Containers run in user namespace.