Debian 13 trixie

Podman : インストール2025/08/22

 

コンテナー管理ツール Podman をインストールします。

[1] Podman をインストールします。
root@dlp:~#
apt -y install podman
[2] debian 公式イメージファイルをダウンロードし、コンテナーから echo を実行して [Welcome to the Podman World] を出力します。
# 公式イメージダウンロード

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

# コンテナーで echo を実行

root@dlp:~#
podman run debian /bin/echo "Welcome to the Podman World"

Welcome to the Podman World
[3] コンテナー環境の対話型シェルセッションに接続するには以下のように [-i] オプションと [-t] オプションを付加します。
コンテナー環境内で [exit] すると、ホストのコンソールに戻ってコンテナー環境のプロセスは終了します。
root@dlp:~#
podman run -it debian /bin/bash

root@d91a17fe551b:/#    
# 接続できた
root@d91a17fe551b:/#
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:~#    
# 戻った
[4] コンテナーをデーモンとして起動するには [-d] オプションを付加します。
root@dlp:~#
podman run -itd debian /bin/bash

ed3b1b655e58716d4ad89425caa0f3f01dd051ccaf26486b4eb29b1b01d70441

# podman プロセス表示

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

# コンテナー環境に接続

root@dlp:~#
podman exec -it ed3b1b655e58 /bin/bash

root@ed3b1b655e58:/#    
# 接続できた

root@ed3b1b655e58:/#
exit
# コンテナープロセスを終了する

root@dlp:~#
podman kill ed3b1b655e58

root@dlp:~#
podman ps

CONTAINER ID  IMAGE   COMMAND  CREATED  STATUS  PORTS   NAMES
関連コンテンツ