我正在按照这个链接创建我的第一个docker映像,它成功了,现在我试图从这个链接将这个映像推到我的docker存储库中。但是每当我试图将这个映像推入存储库时,我就会得到这种类型的错误。
denied: requested access to the resource is denied
注:我已成功登录docker
我正在按照这个链接创建我的第一个docker映像,它成功了,现在我试图从这个链接将这个映像推到我的docker存储库中。但是每当我试图将这个映像推入存储库时,我就会得到这种类型的错误。
denied: requested access to the resource is denied
注:我已成功登录docker
当前回答
我的问题是在我的图像名称中使用无效字符(额外的/):
myusername/something/image
无效的映像名称。/上的用户名都尝试dangillmor something-image。希望这能帮助到一些人。
其他回答
您可能需要在docker push之前将docker repo切换为private。
感谢Dean Wu提供的答案和ses的评论,在推送之前,请记得注销,然后从命令行登录到您的docker hub帐户
# you may need log out first `docker logout` ref. https://stackoverflow.com/a/53835882/248616
docker login
根据文件:
You need to include the namespace for Docker Hub to associate it with your account.
The namespace is the same as your Docker Hub account name.
You need to rename the image to YOUR_DOCKERHUB_NAME/docker-whale.
所以,这意味着你必须在推送之前标记你的图像:
docker tag firstimage YOUR_DOCKERHUB_NAME/firstimage
然后你就可以推它了。
docker push YOUR_DOCKERHUB_NAME/firstimage
我在ibmcloud上也遇到了同样的错误。我添加了命名空间,然后试图推动我的图像,它解决了这个问题。
ibmcloud cr namespace-add txts
修改图像名称为"username"/"image_name"
我在git上的问题是项目权限配置。 我已经通过启用“容器注册表”在设置->通用->可见性,项目功能,权限和启用容器注册表为我的项目(链接):
当我在标记图像时使用docker中心名时,它为我工作。(这里,xyz是一个docker中心名)
# Login to docker hub account
docker login
# tag image
docker tag nginx xyz/nginx
# push image
docker push xyz/nginx