The below is what I eventually used to fix it:
microdnf install -y dnf oracle-epel-release-el9
dnf -y install 'dnf-command(config-manager)'
dnf config-manager --enable ol9_codeready_builder
Initially, I was just running microdnf install -y epel-release
but being more specific seemed to work. I also switched to using dnf
instead of microdnf
, though I don't think that made much difference.