DIND problem

I assume you want to build a docker image that contains a binary (or .jar / .exe / etc) which is built in the CI pipeline?

You would use CI artifacts. Define two CI jobs, one builds your executable, the second one (the one with build-oci) builds your container and pushes it to the registry. The second one should depend on the first one.