Investigate use of --install-root argument to microdnf
Summary
As part of Investigation: methodology for creating final l... (#8 - closed), explore using --installroot and associated arguments to microdnf, in order to build out a chrooted ubi-micro environment.
Details
We investigated building the gitlab_base image using--installroot and associated arguments to microdnf in following steps:
- start with a ubi8-micro image, create dir
/install-root/and copy the/folder into/install-root/. - copy
/install-root/from the previous step into the builder image(ubi8-minimal). - use microdnf to install the required software in
/install-root/folder using the--installrootand associated arguments. - Create gitlab_base image from ubi8-micro and copy
/install-root/from builder image into/
We also investigated installing required software into ubi8-micro using redhat's documentation that uses buildah to install the software.
Findings
- Using
--installrootand associated arguments tomicrodnfproduces a gitlab_base image of size 92MB. We also checked this image for wasted space using 'wagoodman/dive' utility and found the final image size to be acceptable size(see attached screenshot of dive analysis). We also verified that with this approach, all the required software is installed and functions correctly.
It is important to start with ubi8-micro and copy it's/folder to/install-root/rather than using empty/install-root/folder as the--installrootin the builder image(ubi8-minimal). Please see this note from @WarheadsSE for a good explaination. - The image produced using buildah (per Red Hat's documentation) produces a image of size 352MB and may require significant changes to the pipelines hence we decided to not use this approach and use the
--installrootapproach detailed above.
Edited by Vasant Tokale