Podman : Install2024/05/05 |
Install Podman that is Container management tool.
|
|
[1] | Install Podman. |
root@dlp:~# apt -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 ubuntu Resolved "ubuntu" as an alias (/etc/containers/registries.conf.d/shortnames.conf) Trying to pull docker.io/library/ubuntu:latest... Getting image source signatures Copying blob 49b384cc7b4a done | Copying config bf3dc08bfe done | Writing manifest to image destination bf3dc08bfed031182827888bb15977e316ad797ee2ccb63b4c7a57fdfe7eb31d # run echo inside a container root@dlp:~# podman run ubuntu /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@591e1ea31c34:/# podman run -it ubuntu /bin/bash root@591e1ea31c34:/# # connected
uname -a Linux 591e1ea31c34 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux root@591e1ea31c34:/# 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 ubuntu /bin/bash a45d9a04eb16c35c28bf2c223a41613a99c4eaddba7e619decbe27e851eb906b # show podman processes root@dlp:~# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a45d9a04eb16 docker.io/library/ubuntu:latest /bin/bash 16 seconds ago Up 16 seconds angry_driscoll # attach to container session root@dlp:~# podman exec -it a45d9a04eb16 /bin/bash root@a45d9a04eb16:/# # connected root@a45d9a04eb16:/# exit
# stop container process # * if force stop, specify [podman kill ***] root@dlp:~# podman stop a45d9a04eb16 root@dlp:~# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
Sponsored Link |
|