Podman : Install2024/11/06 |
Install Podman that is the Container management tool. |
|
[1] | Install Podman. |
[root@dlp ~]# dnf -y install podman
|
[2] | Download an official image and create a Container, next 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 29794b153cd7 done | Copying config 99519fcf3c done | Writing manifest to image destination 99519fcf3c1bc48cecee0f7f22f62b191c209143f07b4b3bd8bbefcaaf53bc76 # 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@885002bf3f06 /]# podman run -it fedora /bin/bash [root@885002bf3f06 /]# # connected
uname -a Linux 885002bf3f06 6.11.5-300.fc41.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Oct 22 20:11:15 UTC 2024 x86_64 GNU/Linux [root@885002bf3f06 /]# 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 12aa6dcd9ac0458df3d15459af47de224b23562a6437918f631812849fca5d02 # show podman processes [root@dlp ~]# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 12aa6dcd9ac0 registry.fedoraproject.org/fedora:latest /bin/bash 13 seconds ago Up 14 seconds vibrant_snyder # attach to container session [root@dlp ~]# podman exec -it 12aa6dcd9ac0 /bin/bash [root@12aa6dcd9ac0 /]# # connected [root@12aa6dcd9ac0 /]# exit
# stop container process (if force stop, specify [kill]) [root@dlp ~]# podman stop 12aa6dcd9ac0 [root@dlp ~]# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
Sponsored Link |
|