Podman : コンテナーイメージを登録する2026/01/09 |
|
コンテナー用のイメージファイルを新規登録するには以下のように設定します。 |
|
| [1] | 例として、こちらで作成した FreeBSD のベースイメージに Apache httpd をインストールして、新しいコンテナーイメージとして登録します。 |
|
root@dlp:~ # podman images REPOSITORY TAG IMAGE ID CREATED SIZE localhost/freebsd-base latest afb96df72092 22 minutes ago 902 MB quay.io/centos/centos stream10 e9ac565bc256 2 days ago 316 MB docker.io/library/ubuntu latest c3a134f2ace4 2 months ago 80.6 MB # コンテナーを起動して [apache24] をインストール root@dlp:~ # podman run freebsd-base /bin/sh -c "pkg install -y apache24" podman ps -a | tail -1 049e87f948da localhost/freebsd-base:latest /bin/sh -c pkg in... 7 minutes ago Exited (0) 6 minutes ago gifted_hermann # [apache24] インストール済みイメージを登録 root@dlp:~ # podman commit 049e87f948da localhost/freebsd-httpd Getting image source signatures Copying blob 6af2ef15f616 skipped: already exists Copying blob ca854c0d6cc9 done | Copying config dbf5f8b9e7 done | Writing manifest to image destination dbf5f8b9e7e2cdef63b93b1dc52d4dadc2deead63a8def4fe3774a76172e9d25root@dlp:~ # podman images REPOSITORY TAG IMAGE ID CREATED SIZE localhost/freebsd-httpd latest dbf5f8b9e7e2 32 seconds ago 1.19 GB localhost/freebsd-base latest afb96df72092 31 minutes ago 902 MB quay.io/centos/centos stream10 e9ac565bc256 2 days ago 316 MB docker.io/library/ubuntu latest c3a134f2ace4 2 months ago 80.6 MB # 登録したイメージからコンテナーを生成し [apache24] 確認 root@dlp:~ # podman run freebsd-httpd /usr/local/sbin/httpd -V
Server version: Apache/2.4.66 (FreeBSD)
Server built: unknown
Server's Module Magic Number: 20120211:141
Server loaded: APR 1.7.5, APR-UTIL 1.6.3, PCRE 10.47 2025-10-21
Compiled using: APR 1.7.5, APR-UTIL 1.6.3, PCRE 10.47 2025-10-21
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
.....
.....
|
| Sponsored Link |
|
|