Rocky 9.x podman basics

From Notes_Wiki

Home > Rocky Linux or CentOS > Rocky Linux 9.x > Rocky 9.x virtualization > Rocky 9.x Podman > Rocky 9.x podman basics

Installation

For installation use:

dnf -y install podman
podman version
podman info


Download rockylinux9 image

For rocky9 podman images use:

podman image search rocky
podman pull docker.io/library/rockylinux:9.0
podman image list -a    #Or simply "podman images"


Move podman containers to other partition from /var

To move podman containers to other partition from default /var (Often for additional disk space use):

   mkdir /mnt/data1/container-files
   mkdir /mnt/data1/container-files/{var-run-containers,var-lib-containers}
   mv /var/run/containers/* /mnt/data1/container-files/var-run-containers/
   mv /var/lib/containers/* /mnt/data1/container-files/var-lib-containers/
   rmdir /var/run/containers/
   rmdir /var/lib/containers/
   ln -s /mnt/data1/container-files/var-run-containers/ /var/run/containers
   ln -s /mnt/data1/container-files/var-lib-containers/ /var/lib/containers

   #After this validate by using various commands such as
   podman images
   podman run --name host1 -it docker.io/library/rockylinux:9.0 bash
   df -h  #Inside container 
   exit


List running containers

We can list podman running containers via:

podman ps -a
podman rm <container-id>

See [[1]]


Get container IP for rootfull container

To get IP of rootfull containers use:

docker inspect <container> | grep -i ip


Home > Rocky Linux or CentOS > Rocky Linux 9.x > Rocky 9.x virtualization > Rocky 9.x Podman > Rocky 9.x podman basics