Authenticate to the registries

You need to configure credentials for all registries that require authentication.

The following registries require authentication:
  • cp.icr.io
  • The air gap registry host, which you configured in the AIRGAP_REGISTRY_HOST environment variable.
To authenticate to the registries, do the following steps.
  1. Configure the name of the authentication file to use to store the credentials for all source container registries. You need to run the export REGISTRY_AUTH_FILE command only once.
    export REGISTRY_AUTH_FILE=path and file name to use for the auth credentials that are generated at login
    The file name to use depends on the software or tool that you are using in your air-gapped process. The command and file names are shown in the following list.
    • For Podman, the command is
      export REGISTRY_AUTH_FILE=$HOME/.ibm-pak/auth.json
      After you run the command and then login with Podman, you can see that the file now contains the registry credentials. The typical file names for Podman are shown in the following list.
      • For Linux®, the path and file name to use is $HOME/.config/containers/auth.json.
      • For the Windows operating system, the path and file name to use is %USERPROFILE%/.config/containers/auth.json.
    • For Docker, the command is
      export REGISTRY_AUTH_FILE=$HOME/.docker/config.json
      After you run the command and then login with Docker, you can see that the file now contains the registry credentials. The typical file names for Docker are shown in the following list.
      • For Linux, the path and file name to use is $HOME/.docker/config.json.
      • For the Windows operating system, the path and file name to use is %USERPROFILE%/.docker/config.json.
  2. Authenticate to the public registry. When you log in to cp.icr.io, you must specify the user as cp. The password is your entitlement key from the IBM® Cloud Container Registry. For more information, see IBM Container software library.
    The following example shows the command to use with Podman.
    podman login cp.icr.io
  3. Authenticate to the air gap registry host. The command to use to set credentials for the air gap registry depends on the software or tool that you are using in your air-gapped process. The command and file names are shown in the following list.
    • For Podman, the command is
      podman login ${AIRGAP_REGISTRY_HOST} -u ${AIRGAP_REGISTRY_USER} -p ${AIRGAP_REGISTRY_PASSWORD}
    • For Docker, the command is
      docker login ${AIRGAP_REGISTRY_HOST} -u ${AIRGAP_REGISTRY_USER} -p ${AIRGAP_REGISTRY_PASSWORD}