Corporate and self-signed certificates
Trust a private CA inside the container before any download or dependency install runs.
If a Source URL or a package repository is served with a certificate from a private CA, the
container needs that CA in its trust store. rpmbuilder looks for mounted certificates at startup and
refreshes the trust store before it fetches sources or installs packages.
Steps
-
Collect the CA certificates as
.crtfiles in one host directory. -
Mount that directory at the anchor path that matches the image family:
Image family Anchor directory Fedora, Rocky Linux, and other Red Hat derived images /etc/pki/ca-trust/source/anchorsopenSUSE /etc/pki/trust/anchors -
Run as usual:
podman run --rm -it \ --volume "${PWD}/sources:/sources:z" \ --volume "${PWD}/output:/output:z" \ --volume "${PWD}/ca:/etc/pki/ca-trust/source/anchors:z" \ --env OUTPUT_USER="$(id -u)" \ quay.io/abn/rpmbuilder:fedora-latest
What the entrypoint does with them
It checks both anchor directories in turn. When one contains files, it refreshes the trust store with
update-ca-trust extract or update-ca-certificates, whichever the distribution provides, and stops
checking. A directory with no certificates is skipped, so mounting an empty one is harmless.
Reading files from a plain HTTP source
A private CA does not help when the URL has an http scheme rather than https. There is nothing to
verify in that case, and the download simply proceeds.
Next
- Enabling COPR and custom repositories for the repository side of a private network.
- Debugging a build when a download still fails after the certificates are mounted.