
Images
Listing Images
podman images
Pulling an Image
podman pull jenkins
Deleting Images
podman rmi <image-name or image-id>
Remove un-used images at once
podman image prune
podman rmi$(podman images-aq)
Building images from a Dockerfile
# . represents that the Dockerfile is present in the location where you are running this command.podman build-t podman-image:1.0.
Saving images to your local in archive
podman image save-o image.tar <image-id>
Load a container from a stored archive
podman load-i archive_name.tar
Tagging an image
podman tag <image-id> target-image-name# Tagging images with a tagpodman tag-t <image-id> target-image-name:tag
Containers
Listing the containers that are running.
podman ps
Listing all containers in your machine
podman ps-a
Running a container
# Running a container normallypodman run <image-id># Running a container in detached modepodman run-d <image-id># Adding a namepodman run-d--name jenkins <image-id>
Stopping a container
podman stop <container-id>
Starting a stopped container
podman start <container-id>
Removing a container
podmanrm <container-id>
Logs of a container
podman logs <container-id># Watching logspodman logs--tail=100-f <container-id>
Copying files from/to a container
# Copying files to a container# It is better to copy files from you podman machine to a container rather than from your local.# podman cp source_path destination_pathpodmancpfile_path_in_your_podman_machine container_id:path_in_your_container# Copying files from your container to your podman machinepodmancpcontainer_id:path_in_your_container file_path_in_your_podman_machine
Logging into a container
podmanexec-it <container-id> /bin/bash# Logging in as a root userpodmanexec-it--user root <container-id> /bin/bash
Creating an image from a container
podaman commit <container-ID> image_name
Inspecting a container
podman inspect <container-id>
Network
Listing Networks
podman networkls
Creating a network
podman network create net-1
Removing a network
podman networkrmnet-1
Attaching network to a container
podman network connect <container-id>
Attaching network at while running the container
podman run-d--network net-1--name jenkins <image-id>
Inspecting a network
podman network inspect net-1
Volumes
Creating a volume
podman volume create volume-1
Listing Volumes
podman volumels
Removing Volumes
podman volumermvolume-1
Removing unused volumes in your machine
podman volume prune
Attaching Volume while running the container
podman run-d--volume volume-1:/var/jenkins_home--network net-1--name jenkins <image-id>
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse