OpenSSL is failing to verify Private CA while running ruby bundler install | Docker Compose

My organization has a self-signed cert for a platform that we use to access our rubygem library. The build process reaches the point of bundler install and then it attempts to verify both rubygems and customdomain.com. Once it reaches the custom domain…it returns Retrying fetcher due to error (2/4): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://customdomain.org/
Before this step, I used the command below
RUN openssl s_client -showcerts -connect mygems.org:443 </dev/null 2>/dev/null | sed -e '/-------BEGIN/,/-----END/!d' | tee "/usr/local/share/ca-certificates/ca.crt" > /dev/null && \ update-certificates
in order to copy the cert directly from the domain itself, to ca-certificates.

I’m using registry.docker.com/library/ruby:2.7.7-slim . What must I do to get the build process to complete while composing my dockerfile with a custom/private ca?

1 Like