Fedora 35
Sponsored Link

Podman : Install2021/11/11

 
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 fedora

Resolved "fedora" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull registry.fedoraproject.org/fedora:latest...
Getting image source signatures
.....
.....
Writing manifest to image destination
Storing signatures
1b52edb0818147bea39780625ec01ab46944284acf16d8bcfa4055f8a854a9f5

# run echo inside a container

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

[root@c466d78a528d /]#    
# connected
[root@c466d78a528d /]#
uname -a

Linux c466d78a528d 5.14.10-300.fc35.x86_64 #1 SMP Thu Oct 7 20:48:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@c466d78a528d /]#
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 fedora /bin/bash

0c5954f2e21190f86c892de6e256951c1d5576b5d2aa00be6b799778709f56c9

# show podman processes

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE                                     COMMAND     CREATED         STATUS             PORTS       NAMES
0c5954f2e211  registry.fedoraproject.org/fedora:latest  /bin/bash   11 seconds ago  Up 11 seconds ago              funny_jang

# attach to container session

[root@dlp ~]#
podman exec -it 0c5954f2e211 /bin/bash

[root@0c5954f2e211 /]#    
# connected

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

[root@dlp ~]#
podman stop 0c5954f2e211

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES
Matched Content