4.5. bootc-image-builder を使用した VMDK イメージの作成
bootc イメージから仮想マシンディスク (VMDK) を作成し、それを vSphere などの VMware の仮想化プラットフォーム内か、Oracle VirtualBox で使用します。
前提条件
- ホストマシンに Podman がインストールされている。
-
podman login registry.redhat.io使用して Red Hat Registry に認証した。 -
rhel10/bootc-image-builderコンテナーイメージをプルした。
手順
次の内容の
Containerfileを作成します。FROM registry.redhat.io/rhel10/rhel-bootc:latest RUN dnf -y install cloud-init open-vm-tools && \ ln -s ../cloud-init.target /usr/lib/systemd/system/default.target.wants && \ rm -rf /var/{cache,log} /var/lib/{dnf,rhsm} && \ systemctl enable vmtoolsd.servicebootc イメージをビルドします。
# podman build . -t localhost/rhel-bootc-vmdk- 以前に作成した bootc イメージから VMDK ファイルを作成します。
以前に作成した bootc イメージから VMDK ファイルを作成します。このイメージは、
registry.redhat.io/rhel10/bootc-image-builder:latestなどのレジストリーからアクセスできる必要があります。# podman run \ --rm \ -it \ --privileged \ -v /var/lib/containers/storage:/var/lib/containers/storage \ -v ./output:/output \ --security-opt label=type:unconfined_t \ --pull newer \ registry.redhat.io/rhel10/bootc-image-builder:latest \ --type vmdk \ --config /config.toml \ localhost/rhel-bootc-vmdk:latestbootc イメージの VMDK ディスクファイルは、
output/vmdkディレクトリーに保存されます。