5.5. bootc-image-builder를 사용하여 VMDK 이미지 생성


bootc-image-builder 를 사용하여 Red Hat Enterprise Linux bootc 이미지에서 VMI(가상 머신 디스크)를 생성합니다. 이 아티팩트를 사용하면 VMware vSphere에서 가상 머신으로 부팅 가능한 컨테이너 이미지를 배포할 수 있습니다.

  • registry.redhat.io/rhel10/bootc-image-builder:latest 와 같은 레지스트리의 컨테이너 이미지를 사용하는 경우 로컬 스토리지를 마운트할 필요가 없습니다.
  • 로컬로 빌드된 컨테이너 이미지를 사용하는 경우 -v /var/lib/containers/storage:/var/lib/containers/storage 인수를 포함해야 합니다.

사전 요구 사항

  • 호스트 시스템에 Podman이 설치되어 있어야 합니다.
  • podman login registry.redhat.io 를 사용하여 Red Hat Registry에 인증했습니다.
  • rhel10/bootc-image-builder 컨테이너 이미지를 가져왔습니다.

프로세스

  1. 다음 콘텐츠를 사용하여 Containerfile 을 생성합니다.

    FROM quay.io/<namespace>/<image>: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.service
  2. bootc 이미지를 빌드합니다.

    $ sudo podman build . -t localhost/rhel-bootc-vmdk
  3. 선택 사항: 사용자 추가 또는 파일 시스템 구성과 같은 이미지 구성을 사용자 지정하려면 현재 작업 디렉터리에 config.toml 파일을 생성합니다.

    [[customizations.user]]
    name = "user"
    password = "pass"
    key = "ssh-rsa AAA ... user@email.com"
    groups = ["wheel"]
  4. 컨테이너를 실행하기 전에 출력 디렉터리를 초기화합니다. 디렉터리가 이미 존재하는 경우 -p 인수를 사용하여 명령이 실패하지 않도록 합니다.

    $ mkdir -p ./output
  5. 이전에 생성한 bootc 이미지에서 VMDK 파일을 생성합니다. registry.redhat.io/rhel10/bootc-image-builder:latest 와 같은 레지스트리에서 이미지에 액세스할 수 있어야 합니다.

    참고

    config.toml 파일을 생성한 경우에만 --config 옵션이 필요합니다. 그렇지 않은 경우 --config /config.toml 행 및 해당 -v ./config.toml:/config.toml:ro 볼륨 마운트를 생략합니다.

    $ sudo podman run \
        --rm \
        --privileged \
        -v /var/lib/containers/storage:/var/lib/containers/storage \
        -v ./output:/output \
        -v ./config.toml:/config.toml:ro \
        --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:latest

    bootc 이미지의 VMDK 디스크 파일은 출력/vmdk 디렉터리에 저장됩니다.

다음 단계

  • 이미지를 배포할 수 있습니다.
  • 이미지를 업데이트하고 변경 사항을 레지스트리로 푸시할 수 있습니다. RHEL bootc 이미지 관리를 참조하십시오.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동