Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 6. 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.

To install content to a container by using only local resources, you can use one of the following options:

  • Bind mounts: Override the container’s store with the host’s.
  • Derived image: Create a new container image with your custom certificates by building it using a Containerfile.

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

Use bound mounts to override the container’s store with the host’s.

Procedure

  • Run RHEL bootc image and use 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 $(pwd)/output:/output \
      -v /etc/pki:/etc/pki \
      localhost/<image> \
      --type iso \
      --config /config.toml \
      quay.io/<namespace>/<image>:<tag>
    Copy to Clipboard Toggle word wrap

Verification

  • The disk image build process should now be able to access internal certificates.

Create a new container image with your custom certificates by building it using a Containerfile.

Procedure

  1. Create a Containerfile:

    FROM <internal_repository>/<image>
    RUN  mkdir -p /etc/pki/ca-trust/extracted/pem/
    COPY tls-ca-bundle.pem /etc/pki/ca-trust/extracted/pem/
    RUN  rm -rf /etc/yum.repos.d/*
    COPY echo-rhel9_4.repo /etc/yum.repos.d/
    Copy to Clipboard Toggle word wrap
  2. Build the custom image:

    # podman build -t <your_image> .
    Copy to Clipboard Toggle word wrap
  3. Run the <your_image>:

    # podman run -it --rm <your_image>
    Copy to Clipboard Toggle word wrap

Verification

  • List the certificates inside the container:

    # ls -l /etc/pki/ca-trust/extracted/pem/
    tls-ca-bundle.pem
    Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2026 Red Hat
Retour au début