Podman : Install2024/05/03 |
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 605514dc1a64 done | Copying config 19f52f5823 done | Writing manifest to image destination 19f52f5823316d07d071518185e05e3ed572109abbfeb898ca28655e4dca77fb # 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@8d68b1cc62ff /]# podman run -it fedora /bin/bash [root@8d68b1cc62ff /]# # connected
uname -a Linux 8d68b1cc62ff 6.8.7-300.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 17 19:21:08 UTC 2024 x86_64 GNU/Linux [root@8d68b1cc62ff /]# 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 1f497e94dec18f8e0e9a04d70f33f3ed807b85a67b38aa31317eee5cdeec9dd8 # show podman processes [root@dlp ~]# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 1f497e94dec1 registry.fedoraproject.org/fedora:latest /bin/bash 23 seconds ago Up 24 seconds dreamy_turing # attach to container session [root@dlp ~]# podman exec -it 1f497e94dec1 /bin/bash [root@1f497e94dec1 /]# # connected [root@1f497e94dec1 /]# exit
# stop container process (if force stop, specify [kill]) [root@dlp ~]# podman stop 1f497e94dec1 [root@dlp ~]# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
Sponsored Link |
|