Docker:“;登录尝试https://hub.docker.com/v2/ 失败,状态为:404未找到;戴软呢帽25
我在Fedora 25安装了Docker CE 当我尝试使用下面的命令登录docker hub时,我得到了一个错误Docker:“;登录尝试https://hub.docker.com/v2/ 失败,状态为:404未找到;戴软呢帽25,docker,virtualbox,fedora,Docker,Virtualbox,Fedora,我在Fedora 25安装了Docker CE 当我尝试使用下面的命令登录docker hub时,我得到了一个错误 $ docker login --username xxx --password yyy https://hub.docker.com/ WARNING! Using --password via the CLI is insecure. Use --password-stdin. Error response from daemon: login attempt to http
$ docker login --username xxx --password yyy https://hub.docker.com/
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: login attempt to
https://hub.docker.com/v2/ failed with status: 404 Not Found
$ docker --version
Docker version 17.07.0-ce, build 8784753
$ docker-machine --version
docker-machine version 0.12.2, build 9371605
请注意,同样的命令在Ubuntu 16.04中运行良好
我能想到的唯一区别是ubuntu有docker,fedora有docker ce
不知道为什么我只在Fedora上出现这个错误。当Fedora安装在virtual box VM上时,我会遇到此错误。当它是hub.docker.com时,您无需指定注册表
docker login --username xxx --password yyy
使用不带URL的上述命令,它应该可以工作您可以使用Tarun提到的上述命令,或者只是将参数缩写为命令,用户名为
-u
,密码为-p
下面是docker登录的基本屏幕截图
如中所述
注册表可能只实现V1(或者尚未配置为使用V2规范,在这种情况下,必须将守护进程配置为支持遗留注册表)
您可以使用“docker info”命令验证:
docker info
...
Server Version: 17.09.0-ce
Operating System: Ubuntu 16.04.3 LTS
...
Registry: https://index.docker.io/v1/
因此,它失败了
docker login --username my_login --password my_password
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password
Docker Hub是默认注册表,因此无需指定注册表(即,只需Docker登录--username….即可) 但是,出现此错误的原因是,hub.docker.com是docker hub网站的域,而不是支持docker hub的注册表;注册表位于index.docker.io(例如docker login index.docker.io) 简而言之,运行如下命令 PS D:>docker登录 使用您的Docker ID登录以从Docker Hub推拉图像。如果您没有Docker ID,请转到创建一个。 用户名: 密码: 登录成功
PS D:>我在为Docker应用程序设置Jenkins管道时遇到了类似的问题 问题是我在Jenkinsfile构建阶段,用作Docker的注册表:
stage('Push image') {
/* Finally, we'll push the image with two tags:
* First, the incremental build number from Jenkins
* Second, the 'latest' tag.
* Pushing multiple tags is cheap, as all the layers are reused. */
docker.withRegistry('https://hub.docker.com', 'Dockerhub') {
app.push("${env.BUILD_NUMBER}")
app.push("latest")
}
}
以下是我如何修复它的方法:
我只需将docker注册表从修改为:
然后对于我在Jenkins配置中的Dockerhub凭证:
username: my_username (not my email address)
password: my_password
就这些
我希望这有助于输入以下命令:
docker login
然后输入您的用户名和密码当我没有指定dockerhub URL时,我遇到了以下错误。错误是-->守护进程的错误响应:get:unauthorized:error username或password在其他一些操作系统上尝试,看看相同的用户名和密码是否有效是的。它在Ubuntu 16.04上有效,但在Fedora 25上失败。当然。会这样做。MaxReglisse-我在虚拟机上运行的Fedora 25中有问题,但在主机Ubuntu 16.10中没有。当我运行命令
docker info
时,结果是相同的(Registry:https://index.docker.io/v1/
)我不知道为什么它在Ubuntu中工作,但在Fedora中不工作。有什么建议吗?MaxReglisse-对我最后的评论有什么建议吗?
docker login