Podman : コンテナーイメージを登録する2023/04/26 |
|
コンテナー用のイメージファイルを新規登録するには以下のように設定します。
|
|
| [1] | 例として、公式からダウンロードした既存のイメージファイルのシステムに [httpd] をインストールして、[httpd] 入りのイメージを新規登録します。 コンテナーは [run] する毎に新しいものが生成されるため、コンテナー環境を最新化して [exit] した後に、直近のコンテナーを登録対象とします。 |
|
# 現在登録されているイメージ一覧を表示 [root@dlp ~]# podman images REPOSITORY TAG IMAGE ID CREATED SIZE registry.fedoraproject.org/fedora latest c9bfca6d0ac2 6 days ago 196 MB # 最新のイメージでコンテナーを起動し [httpd] をインストール [root@dlp ~]# podman run fedora /bin/bash -c "dnf -y upgrade; dnf -y install httpd" podman ps -a | tail -1 5becc5a47698 registry.fedoraproject.org/fedora:latest /bin/bash -c dnf ... 55 seconds ago Exited (0) 12 seconds ago sharp_cartwright # [httpd] インストール済みイメージを登録 [root@dlp ~]# podman commit 5becc5a47698 srv.world/fedora-httpd Getting image source signatures Copying blob 8f5d7501282e skipped: already exists Copying blob 2ad6b1807274 done Copying config 51d32e13e2 done Writing manifest to image destination Storing signatures 51d32e13e2f49b479ebc0d7908e802dfd06e651739ce307a65b2ea1513f37c24 # 確認 [root@dlp ~]# podman images REPOSITORY TAG IMAGE ID CREATED SIZE srv.world/fedora-httpd latest 51d32e13e2f4 22 seconds ago 477 MB registry.fedoraproject.org/fedora latest c9bfca6d0ac2 6 days ago 196 MB # 登録したイメージからコンテナーを生成し [httpd] 確認 [root@dlp ~]# podman run srv.world/fedora-httpd /usr/sbin/httpd -V
Server version: Apache/2.4.57 (Fedora Linux)
Server built: Apr 11 2023 00:00:00
Server's Module Magic Number: 20120211:127
Server loaded: APR 1.7.2, APR-UTIL 1.6.3, PCRE 10.42 2022-12-11
Compiled using: APR 1.7.2, APR-UTIL 1.6.3, PCRE 10.42 2022-12-11
Architecture: 64-bit
Server MPM: event
threaded: yes (fixed thread count)
forked: yes (variable process count)
.....
.....
|
| Sponsored Link |
|
|