7.2. Using the UBI micro images
You can build a ubi-micro container image by using the Buildah tool.
Prerequisites
-
The
container-toolsmeta-package is installed.
Procedure
Pull and build the
registry.access.redhat.com/ubi10/ubi-microimage:# microcontainer=$(buildah from registry.access.redhat.com/ubi10/ubi-micro)Mount a working container root filesystem:
# micromount=$(buildah mount $microcontainer)Install the
httpdservice to themicromountdirectory:# dnf install \ --installroot $micromount \ --releasever=/ \ --setopt install_weak_deps=false \ --setopt=reposdir=/etc/yum.repos.d/ \ --nodocs -y \ httpd # dnf clean all \ --installroot $micromountUnmount the root file system on the working container:
# buildah umount $microcontainerCreate the
ubi-micro-httpdimage from a working container:# buildah commit $microcontainer ubi-micro-httpd
Verification
Display details about the
ubi-micro-httpdimage:# podman images ubi-micro-httpd localhost/ubi-micro-httpd latest 7c557e7fbe9f 22 minutes ago 151 MB