Skip to content

Commit

Permalink
Import CA certificates for extra repository files
Browse files Browse the repository at this point in the history
Upstream commit: d2d1fc5

If extra repositories are located on an HTTPS server with
a certificate signed by a private authority, additional CA
certificates need to be trusted in the container. Otherwise, DNF
invoked in the container will fail to access the repositories:

        STEP 6/15: RUN set -x &&     dnf -y --refresh upgrade;     dnf -y install dnf-plugins-core;     dnf -y copr enable rpmsoftwaremanagement/test-utils;
        + dnf -y --refresh upgrade
        [...]
        Tag repository for rhel-9.6.0-candidate (x86_64 0.0  B/s |   0  B     00:00
        Errors during downloading metadata for repository 'baseos-ci-tag-repository':
          - Curl error (60): SSL peer certificate or SSH remote key was not OK for https://[...]/repodata/repomd.xml [SSL certificate problem: unable to get local issuer certificate]
        Error: Failed to download metadata for repo 'baseos-ci-tag-repository': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
  • Loading branch information
ppisar committed Oct 21, 2024
1 parent 5cbad54 commit bbae18d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ RUN set -x && \
echo -e "deltarpm=0" >> /etc/dnf/dnf.conf && \
echo -e "install_weak_deps=0" >> /etc/dnf/dnf.conf

# Import extra CA certificates
COPY ./ca-trust/ /etc/pki/ca-trust/source/anchors/
RUN update-ca-trust

# Copy extra repo files
COPY ./repos.d/ /etc/yum.repos.d/

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ default:
If any additional repositories are needed to be added to the container image,
you can place them into the `repos.d` directory (mainly useful for RHEL).

If any additional CA certificates are needed to be trusted in the container
image, e.g. for the additional repositories, you can place them into the
`ca-trust` directory.

During the build, any RPMs found in the `rpms` directory are installed in the
image. Place your RPMs to be tested in this directory.

Expand Down
1 change: 1 addition & 0 deletions ca-trust/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*

0 comments on commit bbae18d

Please sign in to comment.