Docker push to private registry error [denied:请求访问资源被拒绝]

zazmityj  于 12个月前  发布在  Docker
关注(0)|答案(3)|浏览(185)

我这样登录:

PS C:\workl> docker login some-registry.io -u [email protected] -p somePasswrod 
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded

字符串
当我运行docker images时,

CREATED = user/custom-images
tag 1 
imageID=34e982156f


然后我试着推

docker push user/custom-image:1
The push refers to repository [docker.io/library/custom-image]
50c2af6d2450: Preparing
862d28b9e0d9: Preparing 
...
...
878dab86cf0f: Waiting
denied: requested access to the resource is denied


为什么?我正在添加一个标签,并看到其他人在网上类似于这一点,但似乎无法找到解决方案。我可以拉得很好。

lrpiutwd

lrpiutwd1#

您需要按照以下步骤来推送到容器:
1/在docker hub https://hub.docker.com/repositories中创建一个仓库:
只需单击创建新存储库。
2/标记您的本Map像:
docker tag /
repo_name是您在步骤1中创建的名称
3/提交图像:

docker commit <existing-container> <hub-user>/<repo-name>

字符串
4/最后推它:

docker push <hub-user>/<repo-name>

kuuvgm7e

kuuvgm7e2#

正如@altvits所说,
如果你想推送到some-registry.io,你需要像docker image tag image:tag some-registry.io/path/image:tag一样标记它,并将其推送为docker image push some-registry.io/path/image:tag
如果没有标记,推送将尝试推送到默认位置,在您的情况下,默认位置是docker.io

ukdjmx9f

ukdjmx9f3#

您必须将用户更改为email protected(https://stackoverflow.com/cdn-cgi/l/email-protection):

CREATED = user/custom-images
docker push user/custom-image:1

字符串

CREATED = [email protected]/custom-images
docker push [email protected]/custom-image:1

相关问题