Podman Command Cheat Sheet on Linux

Updated: 5 days ago

Podman is a Linux native tool designed to find, run, build, share and deploy applications using Open Containers Initiative ( OCI) Containers and Container Images. We collect this basic podman cheat sheet to help you learn it efficiently.

Podman Cheat Sheet

podman run --rm -it [--name name] image:tag command

  • Run a container based on a given image.

  • --rm Remove the container after it exits

  • -it Connects the container to the terminal

  • --name name Connect the container to the terminal

  • image:tag The image used to create the container

  • command A command to run (/bin/bash for example)

  • -d Run the container in the background

  • -p 8080:32000 Expose container port 8080 as localhost:32000

  • -v /var/lib/mydb:/var/lib/db Map the /var/lib/mydb directory on localhost to a volume named /var/lib/db inside the container

podman commit container newImage:tag

Create a new image based on the current state of a running container

podman create [--name name] image:tag

Create (but don’t start) a container from an image

podman start container

Start an existing container from an image

podman restart container

Restart an existing container

podman wait container1 [container2...]

Wait on one or more containers to stop

podman stop container

Stop a running container gracefully

podman kill container

Send a signal to a running container

podman rm [-f] container

Remove a container (use -f if the container is running)

podman stats container

Display a live stream of a container’s resource usage

podman inspect container

Return metadata (in JSON) about a running container



51 views

Join our mail group. Get a free Linux account on Cloud.

Never miss a post!

Want a free Linux account?  This account can be used to login to our cloud server and practice Linux commands.

 
kamateravps.gif
topbackgroud.png

✔ Linux Commands   ✔ Linux Skills    ✔ LinuxPerformance   ✔ Linux Interview

Some articles are from the public internet. If you find your article misused or undesired here and you don't want us to display it, please let us know and we'll remove it immediately.