CentOS Stream 9
Sponsored Link

Podman : Install2022/03/14

 
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:stream9

Resolved "centos" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull quay.io/centos/centos:stream9...
Getting image source signatures
.....
.....
Writing manifest to image destination
Storing signatures
44ffcc4acee84be468078511bdf44a718f0e172b67f6fba84d0e66a94cb77b0a

# run echo inside a container

[root@dlp ~]#
podman run centos:stream9 /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:stream9 /bin/bash

[root@0515ac50141f /]#    
# connected
[root@0515ac50141f /]#
uname -a

Linux 0515ac50141f 5.14.0-70.el9.x86_64 #1 SMP PREEMPT Thu Feb 24 23:01:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@0515ac50141f /]#
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:stream9 /bin/bash

52e059ca3237967b89efd6330a7bddbc6d38c2e64c8a62d7a045c0e1c953bff7

# show podman processes

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE                          COMMAND     CREATED        STATUS             PORTS       NAMES
52e059ca3237  quay.io/centos/centos:stream9  /bin/bash   9 seconds ago  Up 10 seconds ago              keen_fermat

# attach to container session

[root@dlp ~]#
podman exec -it 52e059ca3237 /bin/bash

[root@52e059ca3237 /]#    
# connected

[root@52e059ca3237 /]#
exit
# stop container process (if force stop, specify [kill])

[root@dlp ~]#
podman stop 52e059ca3237

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
Matched Content