15.4. Configuring container pull secrets
To fetch container images, you must configure a host system with a "pull secret", which includes the host updates. See the appendix about Injecting secrets in image mode for RHEL for more details.
You can configure the container pull secrets to an image that is already built. If you use an external installer such as Anaconda for bare metal, or bootc-image-builder, you must configure the systems with any applicable pull secrets.
The host bootc updates write the configuration to the /etc/ostree/auth.json file, which is shared with rpm-ostree.
Podman does not have system wide credentials. Podman accepts the containers-auth locations that are underneath the following directories:
-
/run: The content of this directory vanishes on reboot, which is not desired. -
/root: Part of root home directory, which is local mutable state by default.
To unify bootc and Podman credentials, use a single default global pull secret for both bootc and Podman. The following container build is an example to unify the bootc and the Podman credentials. The example expects a secret named creds to contain the registry pull secret to build.
Procedure
-
Create a symbolic link between
bootcand Podman to use a single pull secret. By creating the symbolic link, you ensure that both locations are present to a common persistent file embedded in the container image. Create the
/usr/lib/container-auth.jsonfile.FROM quay.io/<namespace>/<image>:<tag> COPY containers-auth.conf /usr/lib/tmpfiles.d/link-podman-credentials.conf RUN --mount=type=secret,id=creds,required=true cp /run/secrets/creds /usr/lib/container-auth.json && \ chmod 0600 /usr/lib/container-auth.json && \ ln -sr /usr/lib/container-auth.json /etc/ostree/auth.jsonWhen you run the containerfile, the following actions happen:
-
The Containerfile makes
/run/containers/0/auth.jsona transient runtime file. -
It creates a symbolic link to the
/usr/lib/container-auth.json. -
It also creates a persistent file, which is also symbolic linked from
/etc/ostree/auth.json.
-
The Containerfile makes