Rocky_Linux_8
Sponsored Link

Podman : Install2021/07/29

 
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 docker.io/rockylinux/rockylinux

Trying to pull docker.io/rockylinux/rockylinux:latest...
Getting image source signatures
.....
.....
Writing manifest to image destination
Storing signatures
333da17614b642a228c30edcb2bddfdf17b2d713ae71b7930c44b714ff8b92e7

# run echo inside a container

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

[root@667ee89589ad /]#    
# connected
[root@667ee89589ad /]#
uname -a

Linux 667ee89589ad 4.18.0-305.7.1.el8_4.x86_64 #1 SMP Tue Jun 29 19:22:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[root@667ee89589ad /]#
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 rockylinux /bin/bash

c2eacab8ff57b02f1684becb071fff5787182613758171b981979f5f981e23bf

# show podman proceses

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE       COMMAND    CREATED        STATUS            PORTS   NAMES
c2eacab8ff57  rockylinux  /bin/bash  7 seconds ago  Up 7 seconds ago          confident_heisenberg

# attach to container session

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

[root@c2eacab8ff57 /]#    
# connected

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

[root@dlp ~]#
podman stop c2eacab8ff57

[root@dlp ~]#
podman ps

CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES
Matched Content