Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 5. Best practices for running containers by using local sources


You can access content hosted in an internal registry that requires a custom Transport Layer Security (TLS) root certificate, when running RHEL bootc images.

You can install content to a container by using only local resources in two way: * By using the bind mounts: This option overrides the container’s store with the host’s. * By using the derived image option: This option creates a new container image with your custom certificates by building it with a Containerfile.

You can use the same techniques to run a bootc-image-builder container or a bootc container when appropriate.

5.1. Importing custom certificate to a container by using bind mounts

To import custom certificates into Red Hat Enterprise Linux containers by using bind mounts, you can establish trust for private certificate authorities. Providing certificates at runtime allows applications to establish connections without requiring you to rebuild the container image for every credential update.

Procedure

  • Run a bootc-image-builder tool and use a bind mount, for example -v /etc/pki:/etc/pki, to override the container’s store with the host’s:

    # podman run \
      --rm \
      -it \
      --privileged \
      --pull=newer \
      --security-opt label=type:unconfined_t \
      -v ./output:/output \
      -v /etc/pki:/etc/pki \
      registry.redhat.io/rhel10/bootc-image-builder:latest \
      --type iso \
      --config /config.toml \
      quay.io/<namespace>/<image>:<tag>

Verification

  • The disk image build process can access internal certificates.

5.2. Importing custom certificates to an image by using a Containerfile

Import custom certificates into your Red Hat Enterprise Linux container image by defining them in the Containerfile. By adding these certificates during the build process, you can enable containerized applications to establish trusted connections with internal services or private certificate authorities.

Include instructions to install custom certificate roots with a Containerfile.

Procedure

  1. Create a Containerfile:

    FROM <internal_repository>/<image>
    # Add certificate to the input set of anchors
    COPY additional-certificate-root.pem /etc/pki/ca-trust/source/anchors
    RUN update-ca-trust
  2. Build the custom image:

    # podman build -t <your_image> .
  3. Run the <your_image>:

    # podman run -it --rm <your_image>

Verification

  • Verify your certificate is in the generated merged store:

    # cat etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
    ...
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2026 Red Hat
Nach oben