If your goal is to leverage Red Hat Universal Base Image micro-variants to package your software with dependencies available via Red Hat RPMs and you need to leverage Red Hat's OpenSSL to support FIPS-140, you can use the following approach to install the correct OpenSSL module and keep your RPM database accurate so your image gets graded correctly by vulnerability scanners (which depend on this database):
- Use a multi-stage
Dockerfile/Containerfile - In the first stage, build your software with any RPM-based build time dependencies using regular UBI or builder images
- In the second stage, copy your software artifacts into a UBI micro image using
COPY --from=... - In the third stage, to install any RPM-based runtime dependencies using a regular UBI image, copy the root filesystem of the second stage into a directory like
/mnt/rootfsand then install any needed RPMs using `dnf --installroot=/