Trying to install git into a Redhat UBI 8 minimal image with microdnf fails. I've traced the problem I think to the install of shadow-utils, which git requires. Trying to install shadow-utils alone fails as well. I had no trouble installing other common build environment tooling until I added git to the list, and it started failing on shadow-utils.
I can work around by using a non-minimal image and installing with yum instead of microdnf. Still, this seems like it should work. Does anyone have a workaround other than using a larger image to start with?
~$ docker run --rm -it registry.access.redhat.com/ubi8/ubi-minimal /bin/bash
[root@965febf561a2 /]# microdnf install shadow-utils
(microdnf:10): librhsm-WARNING **: 06:29:14.389: Found 0 entitlement certificates
(microdnf:10): librhsm-WARNING **: 06:29:14.390: Found 0 entitlement certificates
Downloading metadata...
Downloading metadata...
Downloading metadata...
Package Repository Size
Installing:
libsemanage-2.9-3.el8.x86_64 ubi-8-baseos 168.6 kB
shadow-utils-2:4.6-11.el8.x86_64 ubi-8-baseos 1.3 MB
Transaction Summary:
Installing: 2 packages
Reinstalling: 0 packages
Upgrading: 0 packages
Removing: 0 packages
Downgrading: 0 packages
Downloading packages...
Running transaction test...
Installing: libsemanage;2.9-3.el8;x86_64;ubi-8-baseos
Installing: shadow-utils;2:4.6-11.el8;x86_64;ubi-8-baseos
error: Error -1 running transaction
I do not know for certain, but I believe that it is because your kernel is too old. I had exactly the same problem building an image on an Ubuntu 14.04 box with kernel 3.13.0-151 running Docker 18.06-1. The same Dockerfile builds fine on an Ubuntu 16.04 box with kernel 4.4.0-101 running the same build of Docker. I couldn't find any other configuration differences between those hosts.