8.2. UBI 마이크로 이미지 사용
Buildah 툴을 사용하여 ubi-micro 컨테이너 이미지를 빌드할 수 있습니다.
사전 요구 사항
-
container-toolsmeta-package가 설치되어 있습니다.
사전 요구 사항
-
containers-toolmeta-package에서 제공하는podman툴이 설치됩니다.
절차
registry.access.redhat.com/ubi8/ubi-micro이미지를 가져와서 빌드합니다.# microcontainer=$(buildah from registry.access.redhat.com/ubi9/ubi-micro)작업 컨테이너 루트 파일 시스템을 마운트합니다.
# micromount=$(buildah mount $microcontainer)httpd서비스를마이크로 마운트디렉터리에 설치합니다.# dnf install \ --installroot $micromount \ --releasever=/ \ --setopt install_weak_deps=false \ --setopt=reposdir=/etc/yum.repos.d/ \ --nodocs -y \ httpd # dnf clean all \ --installroot $micromount작업 컨테이너에서 루트 파일 시스템을 마운트 해제합니다.
# buildah umount $microcontainer작동 중인 컨테이너에서
ubi-micro-httpd이미지를 만듭니다.# buildah commit $microcontainer ubi-micro-httpd
검증
ubi-micro-httpd이미지에 대한 세부 정보를 표시합니다.# podman images ubi-micro-httpd localhost/ubi-micro-httpd latest 7c557e7fbe9f 22 minutes ago 151 MB