IBM Cloud Docs
Why does the Container Registry login keep expiring?

Why does the Container Registry login keep expiring?

Logging in to IBM Cloud® Container Registry by using the ibmcloud cr login command is subject to IAM login session limits.

Pushes and pulls to the registry fail after a period of inactivity. The following example is a typical scenario:

  1. You log in by using the ibmcloud cr login command, and then you push or pull an image.
  2. You don't run any other commands for a length of time that is longer than the IAM session inactivity limit.
  3. Without logging in again, you try to push or pull an image and the command fails.

When you log in by using the ibmcloud cr login command, you are subject to the IAM session limits, see Setting limits for login sessions.

You can mitigate the issue by taking one of the following actions:

  • Log in by using an IAM API keyA unique code that is passed to an API to identify the calling application or user. An API key is used to track and control how the API is being used, for example, to prevent malicious use or abuse of the API. because this key is not subject to the IAM session expiry, see Using Docker to authenticate with an API key.
  • Change the IAM login session limits to better suit your needs, see Setting limits for login sessions. The longer you set the limits, the longer your IBM Cloud Container Registry login lasts for.