Fedora 34
Sponsored Link

Podman : Install2021/05/14

 
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
5f05951e20652d401698316fb70d9e7e80e548a03647c033584c871ebc6ccf25

# 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@b31dd536b585 /]#    
# connected
[root@b31dd536b585 /]#
uname -a

Linux b31dd536b585 5.11.12-300.fc34.x86_64 #1 SMP Wed Apr 7 16:31:13 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@b31dd536b585 /]#
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

a1bb699fa7884a569830339c459059fbf945877ec4fde31b5e99ba078ec73c24

# show podman proceses

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE                                     COMMAND    CREATED         STATUS            PORTS   NAMES
a1bb699fa788  registry.fedoraproject.org/fedora:latest  /bin/bash  10 seconds ago  Up 9 seconds ago          beautiful_varahamihira

# attach to container session

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

[root@a1bb699fa788 /]#    
# connected

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

[root@dlp ~]#
podman stop a1bb699fa788

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES
Matched Content