CentOS Stream 10
Sponsored Link

Podman : Install2025/01/21

 

Install Podman that is Container management tool.

[1] Install Podman.
[root@dlp ~]#
dnf -y install podman
[2] Download an official image and create a Container and output the words [Welcome to the Podman World] inside the Container.
# download the official image

[root@dlp ~]#
podman pull centos:stream10

Resolved "centos" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull quay.io/centos/centos:stream10...
Getting image source signatures
Copying blob efdebfb97295 done   |
Copying config 1ef274445e done   |
Writing manifest to image destination
1ef274445e32bffa869b956867e2eaae0625ef909314c41b367b32e3f37c963d

# run echo inside a container

[root@dlp ~]#
podman run centos:stream10 /bin/echo "Welcome to the Podman World"

Welcome to the Podman World
[3] Connect to the interactive session of a Container with [i] and [t] option like follows.
If [exit] from the Container session, the process of a Container finishes.
[root@dlp ~]#
podman run -it centos:stream10 /bin/bash

[root@8e41f9cb78af /]#    
# connected
[root@8e41f9cb78af /]#
uname -a

Linux 8e41f9cb78af 6.12.0-39.el10.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jan 9 16:11:58 UTC 2025 x86_64 GNU/Linux
[root@8e41f9cb78af /]#
exit

exit
[root@dlp ~]#    
# come back
[4] If you'd like to run a Container as a Daemon, add [d] option.
[root@dlp ~]#
podman run -itd centos:stream10 /bin/bash

7fefee719dc763ea47c60f55c06847b7668d2c0f0057a73b4967fb8233ba02ea

# show podman processes

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE                           COMMAND     CREATED         STATUS         PORTS       NAMES
7fefee719dc7  quay.io/centos/centos:stream10  /bin/bash   10 seconds ago  Up 10 seconds              upbeat_chatterjee

# attach to container session

[root@dlp ~]#
podman exec -it 7fefee719dc7 /bin/bash

[root@7fefee719dc7 /]#    
# connected

[root@7fefee719dc7 /]#
exit
# stop container process

[root@dlp ~]#
podman kill 7fefee719dc7

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
Matched Content