The topic provides answers to some frequently 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. You can set and change the secret of the
registry in the Container Registry console by performing the following steps:
- Log on to the Container Registry console.
- On the instances page, click an instance to go to the instance details page.
- In the left-side navigation pane, choose .
- On the Access Credential page, click Set Password in the upper-right corner.
- 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 normal. Otherwise, you cannot access the Container Registry Personal Edition or Enterprise Edition instance, which causes the docker login command timeout.
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 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.
- Run the following command to display the domain names of all the registries that your
account is logged on:
cat ~/.docker/config.json
- 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
- Run the following command to display the domain names of all the registries that your
account is logged on:
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.