Podman : Install2023/04/26 |
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 de924d42b91d done Copying config c9bfca6d0a done Writing manifest to image destination Storing signatures c9bfca6d0ac2a242226fa68db587ab26836e4b3fb5458284be7505e95b12c965 # 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 ~]#
[root@f1b8035eb76a /]# podman run -it fedora /bin/bash [root@f1b8035eb76a /]# # connected
uname -a Linux f1b8035eb76a 6.2.12-300.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Apr 20 23:05:25 UTC 2023 x86_64 GNU/Linux [root@f1b8035eb76a /]# 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 1d0c04da73ac8ac6716e622b3a7393f93ed0ef045fdb6af8b2fb09069cffc607 # show podman processes [root@dlp ~]# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1d0c04da73ac registry.fedoraproject.org/fedora:latest /bin/bash 11 seconds ago Up 11 seconds determined_agnesi # attach to container session [root@dlp ~]# podman exec -it 1d0c04da73ac /bin/bash [root@1d0c04da73ac /]# # connected [root@1d0c04da73ac /]# exit
# stop container process (if force stop, specify [kill]) [root@dlp ~]# podman stop 1d0c04da73ac [root@dlp ~]# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
Sponsored Link |
|