All Products
Search
Document Center

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

Last Updated:Jan 05, 2024

The topic provides answers to some 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 failure:

  • 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 password for the registry, and then use the password for logon. For more information, see Configure an access credential.

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 error, perform the following steps:

  • If you attempt to pull an image from a public repository, check whether the image URL is correct.

    Log on to the Container Registry console and search the public repository for the image tag that you want to pull. Make sure that the image tag exists.

  • If you attempt to pull an image from a private repository, check whether your account has logged on to the registry from which you want to pull the image.

    1. Run the following command to display the domain names of all the registries that your account is logged on:

      cat ~/.docker/config.json                    
    2. Check whether the domain name of the registry from which you want to pull the image exists in the command output.

      If no, log on to the registry.

      If yes, check whether your logon account has the permissions to pull the image. A RAM user does not have permissions by default. For more information about repository access control, 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.