All Products
Search
Document Center

Container Registry:FAQ about errors of docker login, docker push, and docker pull

Last Updated:Dec 25, 2024

The topic provides answers to commonly asked questions about errors of docker login, docker push, and docker pull.

Docker login error

Why does the docker login command fail?

If you fail to log on to a registry by running the docker login command, perform the following steps to troubleshoot the issue:

  • Make sure that the password that you use is the secret of the registry but not the password for your Alibaba Cloud account. To set or modify the secret of a registry, you must use the Container Registry console. Procedure:

    1. Log on to the Container Registry console.

    2. On the instances page, click the card of the instance to go to the instance details page.

    3. In the left-side navigation pane, choose Instances > Access Credential.

    4. On the Access Credential page, click Set Password in the upper-right corner.

    5. In the Set Password dialog box, set a secret for the registry and click Confirm.

  • Make sure that you use the sudo docker login command. After you execute the sudo docker login command, the first password that you are required to enter is the password of the Linux user account. If you enter the secret of the registry, the logon fails.

    If the system prompts "try again" and you are allowed to make at most three attempts after you fail to enter the correct password, this indicates that you are required to enter the password of the Linux user account. If the Docker client exits and the following error is prompted after you enter the wrong password, this indicates that you are required to enter the secret of the registry:

    Error response from daemon: Get https://registry.cn-hangzhou.aliyuncs.com/v2/: unauthorized: authentication required                    
  • If your account is a Resource Access Management (RAM) user, do not use the password that is set with an Alibaba Cloud account. You must log on to the Container Registry console as a RAM user, set a secret for the registry, and then use the secret for logon. For more information, see Configure access credentials for a Container Registry Enterprise Edition instance.

Why does the docker login command time out?

Check whether your network is running as expected. If your network is not running as expected, you cannot access the Container Registry instance. As a result, the docker login command times out.

docker pull error

Why does the docker pull command fail and the Error: image xxx not found message appear?

The following error is returned after you run the docker pull command: Error: image xxx not found.

The preceding error indicates that you fail to pull an image. To troubleshoot the issue, perform the following steps:

  • Check the image URL.

    • Make sure that the image URL that you entered is correct, especially if you pull a public image.

    • You can view the URL and tag of an image in the Container Registry console.

  • Check the logon status of the private repository if you pull an image from a private repository.

    • Run the cat ~/.docker/config.json command to view the domain names of the registries that your account has logged on. Check whether the domain name of the registry from which you want to pull the image exists in the command output.

    • If the domain name of the registry from which you want to pull the image does not exist in the command output, run the docker login command to log on to the registry.

  • Check your account permissions.

    • Make sure that the account you use has the permissions to access or pull the image. If you use a RAM user, the account may have no relevant permissions by default.

    • You can grant relevant permissions to the RAM user by configuring repository access control. For more information, see Repository access control.

Note

In rare cases, the following error is returned, which indicates that the pulled block files fail to pass the verification. If this error occurs, try again.

Error: filesystem layer verification failed for digest

Why do I fail to pull images from a Container Registry Enterprise Edition as an anonymous user?

To pull images as an anonymous user, you must go to the Instance Settings section on the right part of the Overview page and turn on Pull from Anonymous Users.

docker push error

Why does the docker push command fail and the denied: requested access to the resource is denied message appear?

The preceding error indicates that you fail to push an image. The troubleshooting procedure is similar to that for troubleshooting a failure to run the docker pull command. The only difference is that more advanced permissions are required for the logon account.

Why does the docker push command fail?

Make sure that a repository is created before you push images. If no repositories exist, make sure that you have enabled the system to automatically create repositories in the namespace.