Podman : Install |
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 debian Resolved "debian" as an alias (/etc/containers/registries.conf.d/shortnames.conf) Trying to pull docker.io/library/debian:latest... Getting image source signatures Copying blob 80b7316254b3 done | Copying config 047bd8d819 done | Writing manifest to image destination 047bd8d819400f5dab52d40aa2c424109b6627b9e4ec27c113a308e72aac0e7b # run echo inside a container root@dlp:~# podman run debian /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@d91a17fe551b:/# podman run -it debian /bin/bash root@d91a17fe551b:/# # connected cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 13 (trixie)" NAME="Debian GNU/Linux" VERSION_ID="13" VERSION="13 (trixie)" VERSION_CODENAME=trixie DEBIAN_VERSION_FULL=13.0 ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"root@d91a17fe551b:/# 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 debian /bin/bash ed3b1b655e58716d4ad89425caa0f3f01dd051ccaf26486b4eb29b1b01d70441 # show podman processes root@dlp:~# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ed3b1b655e58 docker.io/library/debian:latest /bin/bash 39 seconds ago Up 39 seconds magical_hoover # attach to container session root@dlp:~# podman exec -it ed3b1b655e58 /bin/bash root@ed3b1b655e58:/# # connected root@ed3b1b655e58:/# exit # stop container process root@dlp:~# podman kill ed3b1b655e58 root@dlp:~# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES |
No comments:
Post a Comment