我正在按照这个链接创建我的第一个docker映像,它成功了,现在我试图从这个链接将这个映像推到我的docker存储库中。但是每当我试图将这个映像推入存储库时,我就会得到这种类型的错误。

denied: requested access to the resource is denied

注:我已成功登录docker


当前回答

不知道docker hub发生了什么,但没有一个解决方案对我有效。以下是截至2018年1月,我最终管用的变通办法:

访问hub.docker.com并将存储库更改为private 在你的shell中:

码头工人的图片

存储库标记映像id创建大小 1.975 GB 1.955 GB 1.954 GB

docker 标签 bb38976d03cf dockhub用户名/verse_gapminder:mytag

Docker登录Docker .io

docker push dockhusersername /verse_gapminder:mytag

回到docker hub,将repo更改为public。 这对我很管用。

其他回答

最简单的方法是使用docker桌面(适用于Windows 10或以上版本和mac)

通过提供dockerID注册docker hub

然后点击docker桌面图标在你的机器和->首选项->然后登录到它使用docker枢纽docker/id和密码。

从应用程序登录。我一直在尝试从终端没有运气。

这是版本17.06.1

登录docker后,您需要用前缀命名您的映像。

例如,如果你在docker-hub中的用户名是Shah,图像应该是:

Shah/firstimage

有一个docker文件,要求是立即构建一个映像并将其推送到docker hub

登录Docker集线器 Sudo docker login -u your_username 输入密码 构建映像 Sudo docker build -t your_username/demorepo:1.0 上面没有提到图像名称,因为your_username/demorepo是一个 在docker中心回购。标签名称为1.0 推送图片 Sudo docker推送your_username/demorepo:1.0

将已经存在的图像推送到Docker中心

Login to the Docker hub sudo docker login -u your_username Enter password Tag your image(suppose your image is named as test_docker:1.0) sudo docker tag test_docker:1.0 your_username/demorepo:firstpush Above, firstpush is the tag name given to your image, test_docker with 1.0 Tag. IMPORTANT : (While tagging, the image name is not mentioned) Now in docker images you will have 2 images, one says test_docker 1.0 and the other your_username/demorepo firstpush Push the image sudo docker push your_username/demorepo:firstpush

如果在docker登录后仍然失败,请确保您试图推送到的存储库在一开始就已创建。