Fedora 36
Sponsored Link

Podman : Install2022/05/24

 
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 9c6cc3463716 done
Copying blob 9c6cc3463716 done
Copying config 750037c05c done
Writing manifest to image destination
Storing signatures
750037c05cfe1857e16500167c7c217658e15eb9bc6283020cfb3524c93d1240

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

Linux f265909fc457 5.17.5-300.fc36.x86_64 #1 SMP PREEMPT Thu Apr 28 15:51:30 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@f265909fc457 /]#
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

8a5c65bed667ab01d38c76f1c475b39b64c310055367166816742df49fa7f4ec

# show podman processes

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE                                     COMMAND     CREATED         STATUS             PORTS       NAMES
8a5c65bed667  registry.fedoraproject.org/fedora:latest  /bin/bash   14 seconds ago  Up 15 seconds ago              cool_meitner

# attach to container session

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

[root@8a5c65bed667 /]#    
# connected

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

[root@dlp ~]#
podman stop 8a5c65bed667

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES
Matched Content