AlmaLinux 9
Sponsored Link

Podman : Install2023/03/01

 
Install Podman that is Container management tool.
[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 almalinux

Resolved "almalinux" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/almalinux:latest...
Getting image source signatures
Copying blob 6742b8895cef done
Copying config d3ffa43c25 done
Writing manifest to image destination
Storing signatures
d3ffa43c2567c226da2e4287c5b7c76baa786baf775d647de5572c4d341b36f3

# run echo inside a container

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

[root@2b0359d7ab7e /]#    
# connected
[root@2b0359d7ab7e /]#
uname -a

Linux 2b0359d7ab7e 5.14.0-162.6.1.el9_1.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 15 07:49:10 EST 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@2b0359d7ab7e /]#
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 almalinux /bin/bash

74e96c2ae9009216bff3931fa85281f16504e0c2ea448e4b7268279ec0c050c4

# show podman proceses

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE                               COMMAND     CREATED        STATUS            PORTS       NAMES
74e96c2ae900  docker.io/library/almalinux:latest  /bin/bash   3 seconds ago  Up 4 seconds ago              serene_blackburn

# attach to container session

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

[root@74e96c2ae900 /]#    
# connected

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

[root@dlp ~]#
podman stop 74e96c2ae900

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
Matched Content