Fedora 37
Sponsored Link

Podman : Install
2022/11/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 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
Copying blob 49822917e40a done
Copying config 885d2b38b8 done
Writing manifest to image destination
Storing signatures
885d2b38b8195fef1151979cad84d033484c669e9b7ff803b42df6f165b62aa8

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

Linux 19ff7d25b270 6.0.8-300.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 11 15:09:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@19ff7d25b270 /]#
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

3557aed25847ad5a7618a3df4396f71534847a7c9e75f39569d378307930bf8f

# show podman proceses

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE                                     COMMAND     CREATED         STATUS             PORTS       NAMES
3557aed25847  registry.fedoraproject.org/fedora:latest  /bin/bash   12 seconds ago  Up 12 seconds ago              crazy_diffie

# attach to container session

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

[root@3557aed25847 /]#    
# connected

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

[root@dlp ~]#
podman stop 3557aed25847

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES
Matched Content