我正在按照这个链接创建我的第一个docker映像,它成功了,现在我试图从这个链接将这个映像推到我的docker存储库中。但是每当我试图将这个映像推入存储库时,我就会得到这种类型的错误。
denied: requested access to the resource is denied
注:我已成功登录docker
我正在按照这个链接创建我的第一个docker映像,它成功了,现在我试图从这个链接将这个映像推到我的docker存储库中。但是每当我试图将这个映像推入存储库时,我就会得到这种类型的错误。
denied: requested access to the resource is denied
注:我已成功登录docker
当前回答
我也有同样的问题。在我的情况下,我登录在index.docker.io,并将图像推到docker.io/username/image:标签。
解决方案是在docker中登录。IO通过运行这个命令:
export CI_REGISTRY=docker.io
docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
docker push USERNAME/IMAGE:TAG
输出为:
The push refers to repository [docker.io/USERNAME/IMAGE:TAG] eeb7e16c6369: Preparing 6bd09f46d0ae: Preparing f5a7f7a3fb28: Preparing 07952c1df7f6: Preparing a4522c0d203b: Preparing 3e207b409db3: Preparing 3e207b409db3: Waiting a4522c0d203b: Layer already exists 3e207b409db3: Layer already exists f5a7f7a3fb28: Pushed 6bd09f46d0ae: Pushed 07952c1df7f6: Pushed eeb7e16c6369: Pushed latest: digest: sha256:7ce256fa83ef1eebcaaaa460c4d73f87f2adf304bc6e6c1b83a19d987cd61ad5 size: 1579 Running after_script 00:02 Saving cache 00:01 Uploading artifacts for successful job 00:02 Job succeeded
的问候。
其他回答
docker处理用户id和存储库的方式可能有点令人困惑。 假设您在docker hub上创建了一个用户帐户xyz。新帐户自动建立名称空间xyz。 然后创建一个名为myrepo的存储库。存储库名称实际上是xyz/myrepo。
要推送一个图像,你应该做:
docker push docker.io/xyz/myrepo
如果需要,可以添加“:latest”或其他标签。
如果你得到的资源访问请求被拒绝错误消息:
访问https://hub.docker.com/并以xyz登录。 单击存储库xyz/myrepo。 点击合作者。 添加xyz作为合作者。
如果您已经登录,如果您仍然得到错误。请按照步骤操作,
PS C:\Users\rohit\Docker> docker logout
Removing login credentials for https://index.docker.io/v1/
PS C:\Users\rohit\Docker> docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username: rohithpoya
Password:*****************
Login Succeeded
Logging in with your password grants your terminal complete access to your account.
For better security, log in with a limited-privilege personal access token. Learn more at https://docs.docker.com/go/access-tokens/
PS C:\Users\rohit\Docker> docker push rohithpoya/mongo-enterprise:5
The push refers to repository [docker.io/rohithpoya/mongo-enterprise] 83ee27b8fe98: Pushed
在我的例子中,sudo -E处理此消息失败。解决方案是提供访问do docker而不使用sudo(创建一个组docker,将(Jenkins)用户添加到组中,将组设置在/var/run/docker.sock上)。现在docker push不需要sudo了,而且可以工作。
尝试签出“Docker for Windows”应用程序和签出https://hub.docker.com/网站后执行“Docker登录”和“Docker推送”。 这对我很有帮助。
从应用程序登录。我一直在尝试从终端没有运气。
这是版本17.06.1