简体   繁体   English

当我试图提取公共图像时,为什么我从Docker获得授权错误?

[英]Why do I get an authorization error from Docker when I'm trying to pull a public image?

When I tried to run 当我试图跑

$ docker run -it ubuntu /bin.bash

I got the following error: 我收到以下错误:

Unable to find image 'ubuntu:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/ubuntu/manifests/latest: unauthorized: incorrect username or password.
See 'docker run --help'.

Why am I getting an auth error when the ubuntu image is public? ubuntu映像公开时,为什么会出现auth错误?

Docker for Windows -- 适用于Windows的Docker -

repro docker pull redis repro docker pull redis

I received this error recently. 我最近收到了这个错误。 My solution turned out to be doing a docker logout , which seemed to clear the credential entry slot related to docker hub (speculation). 我的解决方案结果是做了一个docker logout ,这似乎清除了与docker hub相关的凭证输入槽(推测)。 After this, my docker pull redis worked fine. 在此之后,我的docker pull redis工作得很好。

This issue could be caused by being signed into Docker on your machine. 在您的计算机上登录Docker可能会导致此问题。

Signout of Docker, the following screenshot is from a Windows machine, you see will a Signout option if you are signed in. 注销Docker,以下屏幕截图来自Windows机器,如果您已登录,则会看到“注销”选项。

在此输入图像描述

It turns out that Docker checks authentication before it checks what permissions are needed for the image in question. 事实证明,Docker 检查相关图像所需的权限之前会检查身份验证。

Thus, if you have bad auth details in ~/.docker/config.json , your request will be flatly rejected. 因此,如果您在~/.docker/config.json有严重的身份验证详细信息,您的请求将被断然拒绝。 Fix or remove the bad record and you'll be good to go! 修复或删除不良记录,你会很高兴!

The issue is when you login with your email id as your username. 问题是当您使用电子邮件ID作为用户名登录时。 To resolve this: 要解决此问题:

1) Check what your user id is in the right upper corner: https://hub.docker.com/ 1)检查右上角的用户ID: https//hub.docker.com/

2) In your terminal: 2)在您的终端:

  • docker logout 码头注销
  • docker login (Put in the username as obtained above) docker login(输入上面获得的用户名)

Check for docker id in Docker Hub in the upper right corner. 检查右上角Docker Hub中的docker id。 You can log in with both email id and docker id. 您可以使用电子邮件ID和泊坞窗ID登录。 This issue comes when you do it with your email id. 使用您的电子邮件ID进行此问题时会出现此问题。

This wored for me: Try to login in command line 这对我来说很有用:尝试登录命令行

$ docker logout
$ docker login

Be aware that logging in on the commandline requires your username, NOT email address 请注意,登录命令行需要您的用户名,而不是电子邮件地址

Source: https://github.com/docker/hub-feedback/issues/1098 资料来源: https//github.com/docker/hub-feedback/issues/1098

On the window tray, if you've logged in with your email address, please log out and log in with your username, that will do the trick. 在窗口托盘上,如果您已使用您的电子邮件地址登录,请注销并使用您的用户名登录,这样就可以了。 Thanks. 谢谢。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用多个 Docker 主机时,为什么会出现 Unable to create container with image Unable to pull image 错误 pull image? - Why do I get Unable to create container with image Unable to pull image error pulling image when using multiple Docker hosts? 当我尝试使用docker pull peterevans / nominatim时来自守护进程的错误响应 - Error response from daemon when i'm trying docker pull peterevans/nominatim 我正在尝试从一个小项目的图像创建一个容器,但我收到一个错误:docker: 来自守护进程的错误响应 - I'm trying to create a container from an image of a small project, but I get an error: docker: Error response from daemon 尝试将映像转换为容器时,为什么会得到“ docker:无效的参考格式”? - Why do I get 'docker: invalid reference format' when trying to turn my image into a container? 为什么我必须先提取图像才能使docker rest api返回某些信息? - Why do I have to first pull an image before I can get the docker rest api returns something? 为什么我会被未经授权:从docker hub的docker中获取身份验证? - Why do I get unauthorized: authentication required from a docker pull from docker hub? 为什么在尝试加入docker swarm时出现身份验证错误 - Why do I get an authentication error when trying to join docker swarm 为什么在构建 docker 图像时出现此错误? - Why I'm getting this error while building docker image? 尝试使用 Dockerfile 和 podman 从 Docker Hub 中提取基础映像时出现身份验证错误 - Authentification error when trying to pull base image from Docker Hub using Dockerfile and podman 尝试在 golang 中使用 exec.Command() 执行 docker 拉动时,我没有看到进度条 - When trying to do a docker pull using exec.Command() in golang, I am not seeing the progress bars
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM