CentOS Stream 8
Sponsored Link

Podman : Install2021/03/22

 
Install Podman that is Container management tool.
It's possible to use the same ease of use of Docker Cli and also Podman does not need specific Service Daemon.
[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:stream8

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

# run echo inside a container

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

[root@187f65ef0018 /]#    
# connected
[root@187f65ef0018 /]#
uname -a

Linux 187f65ef0018 4.18.0-277.el8.x86_64 #1 SMP Wed Feb 3 20:35:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@187f65ef0018 /]#
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:stream8 /bin/bash

98d7e1e63e3f5ff5a5ccad34ec565bb05d5a1d87ebd795df699a32d0fe2dfb60

# show podman processes

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE                              COMMAND    CREATED         STATUS             PORTS   NAMES
98d7e1e63e3f  registry.centos.org/centos:stream8 /bin/bash  10 seconds ago  Up 11 seconds ago          jovial_mendel

# attach to container session

[root@dlp ~]#
podman exec -it 98d7e1e63e3f /bin/bash

[root@98d7e1e63e3f /]#    
# connected

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

[root@dlp ~]#
podman stop 98d7e1e63e3f

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES
Matched Content