Installation
sudo apt update
sudo apt install podman
Cheatsheet
command |
description |
info |
display detailed podman info |
version |
display podman version |
search <image_name> |
search image |
pull <image_name> |
download image |
images |
list all images |
run -it <image_name> |
run container in interactive mode |
run -it --rm <image_name> |
run container in interactive mode and remove the container after task complete |
ps |
list running containers |
ps -a |
list all containers |
inspect <container_name> |
display container info |
start <container_name> |
start container |
stop <container_name> |
stop container |
rm <container_name> |
remove container |
rmi <container_image> |
remove container image |
port <container_name> |
? |
build -t <image_name> . |
build docker image with the dockerfile config in the current dir |
login <registry_name> |
login to registry |
build -t /<image_name> . |
build docker image in registry with the dockerfile config in the current dir |
push /<container_name> |
push container image to registry |
pod --help |
show help |
pod create --name <pod_name> |
create new empty pod |
pod ls |
list pod |
ps -a --pod |
list all pod |
Configuring registry
- List of default registries found in
/etc/containers/registries.conf
- Store custom configuration in
$HOME/.config/containers/registries.conf
Sample config
unqualified-search-registries = ["docker.io", "quay.io"]
Example to run container
# --name: sets the container name to pdm-nginx
# -p: map system port 8080 to container port 80
podman run --name pdm-nginx -p 8080:80 nginx
# Tag name(ex: latest) can also be mentioned with image
podman run --name container_name> -p 8080:8080 <image_name>.<tag>