We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
:
vi
5
LOPER
CHEAT SHEET
Podman basics
‘This cheat sheet covers the basic podman command set,
containeris ether a container name or a container ID. If tags omitted in imagectag, the default value is /aest.
nae
podman images
List all local images
podman hi
Display information about how an image was built
podman login regisryUt-u username [0 password)
Login to a remote registry
podman pull reistry/username/image:tag
imagestag
Pull an image from a remote registry
podman search searchString
‘earch local cache and remote registries for images
Note Theis of elses is etna in
\ainers/reistries.cant
podman logout
Log out of the current remote registry
BUILDING IMAGES
podman bulld-timogestg
Build and tag an image using the instructions in Dockerfile in the
current directory (don't forget the dot)
podman build image:tag + Dockerfile2
Same as above, but with a different Dockerfile
podman tag image:tagimagetog2
‘Add an additional name toa local Image
pocman tag image:tg ressty/username/Imagetog
Same as above, but the additional name includes a remote registry
podman push regstry/username/imagetag
Push an image to a remote registy
Eton sn
podman run rm it [-name name] imagetag command
Run a container based on a given image,
em Remove the container afterit exits
it Connect the container to the terminal
‘name name Give the container a name
imagetog The image used to create the container
command —-RcoMmand to run Ubinfbash for
examale)
‘Other options
Run the container in the background
-p 8080:32000
Expose container port 8080 as localhost:32000
=v Avrtibimyb:/vertibidb
Map the war/ib/mydb directory on localhost to a volume named
‘Natlib/do inside the container
podman commit
Create a new image based on the current state of a running
container
2 newlmage:tag
podman create [~name nam
imogestag
Create (but don't start)a container from an Image
podman start container
Start an existing container from an image
ppodman restart container
Restart an existing container
podman wait cont
‘Wait on ane or mare containers to stop
podman stop container
inert [eantainer2..J
Stop 2 running container gracefully
ppodman kl con
"Send a signal to a running container
ppodman em fo
Remove a container (use -if the containeris running)
podman stats conta
Display a live stream of a container’s resource usage
podman inspect container
Retum metadata (in SON) about a running containerirene
podman ps (all)
List the running containers on the system (use ~allto include non.
running containers)
ppodman attach container
‘Attach ta.a running container and view its output or control
Ctrl)+p) [Ctl +g) detaches from the container but leaves it
running.
podman exec container command
Execute @ command in a running container
podman top container
Display the running processes of container
podman log tail container
Display the logs of a container
podman pause container | podman unpause container
Pause/unpause al the processes in a container
podman port container
List the port mappings from a container te localhost
fo
podman aff container
Display all the changes to a container’ filesystem
podman cp source target
Copy files and folders between a container and localhost
podman mount container | podman umount container
‘Mount or unmount a containers root filesystem
podman import tarball
Import a tarball and save tas a filesystem image
podman expert 0 outputhl] container
Export the container’ filesystem to a tar file
podman save [o archiveFile] [format docker:
I docker-ain imagetog
chive | aci-archve | oct-lir
Save an image in docker-archive (default) or another format
ive
podman load ar
Load a saved image from docker-archive or another format
erences)
podman rm
imagerag
Remove a local image from local cache (use to force removal)
podman rmi
regstylusernamesimagertog
Remove a remote image from local cache (use to force removal)
Note This does not remove the image from the remote registry.
iecatences
podman version
Display podman version information
podman info
splay information about the podman environment
Penang nue
For more information about podman, visit the Red Hat Developer
website This cheat sheet was written by Doug Tidwell, with huge
thanks to Dan Walsh and Scott McCarty for their technical expertise
and Jason Porter for his visual design skills