Rocky Linux 8.4にpodmanを使ってコンテナーイメージを新規登録する

1.システム前提
OSバージョンの確認

[root@arkgame ~]# cat /etc/redhat-release
Rocky Linux release 8.4 (Green Obsidian)

podmanバージョンの確認

[root@arkgame ~]# podman -v
podman version 3.2.3

2.登録されているイメージを確認

[root@arkgame ~]# podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/rockylinux/rockylinux latest 333da17614b6 4 months ago 234 MB

3.コンテナーを起動し「httpd」をインストール
[root@arkgame ~]# podman run rockylinux /bin/bash -c “dnf -y upgrade;dnf -y install httpd"

略
Installed:
  apr-1.6.3-11.el8.1.x86_64
  apr-util-1.6.1-6.el8.1.x86_64
  apr-util-bdb-1.6.1-6.el8.1.x86_64
  apr-util-openssl-1.6.1-6.el8.1.x86_64
  brotli-1.0.6-3.el8.x86_64
  httpd-2.4.37-39.module+el8.4.0+655+f2bfd6ee.1.x86_64
  httpd-filesystem-2.4.37-39.module+el8.4.0+655+f2bfd6ee.1.noarch
  httpd-tools-2.4.37-39.module+el8.4.0+655+f2bfd6ee.1.x86_64
  mailcap-2.1.48-3.el8.noarch
  mod_http2-1.15.7-3.module+el8.4.0+553+7a69454b.x86_64
  rocky-logos-httpd-84.5-8.el8.noarch

Complete!

4.インストール済みイメージの確認

[root@arkgame ~]# podman ps -a | tail -1
2c5b69cc41ec docker.io/rockylinux/rockylinux:latest /bin/bash -c dnf ... 3 minutes ago Exited (0) 38 seconds ago sharp_babbage

イメージを登録

[root@arkgame ~]# podman commit 2c5b69cc41ec arkgame/rockylinux-httpd
Getting image source signatures
略
8a49f4c867e1367230072bb15246e4f8f9f04450e719d2297fde92ea42e289de

5.登録したイメージを確認

[root@arkgame ~]# podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/arkgame/rockylinux-httpd latest 8a49f4c867e1 About a minute ago 407 MB
docker.io/rockylinux/rockylinux latest 333da17614b6 4 months ago 234 MB

6.httpd場所を確認

[root@arkgame ~]# podman run arkgame/rockylinux-httpd /usr/bin/whereis httpd
httpd: /usr/sbin/httpd /usr/lib64/httpd /etc/httpd /usr/share/httpd /usr/share/man/man8/httpd.8.gz

 

Rocky Linux 8

Posted by arkgame