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

zazmityj  于 2024-01-06  发布在  Docker
关注(0)|答案(3)|浏览(278)

我这样登录:

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

字符串
当我运行docker images时,

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


然后我试着推

  1. docker push user/custom-image:1
  2. The push refers to repository [docker.io/library/custom-image]
  3. 50c2af6d2450: Preparing
  4. 862d28b9e0d9: Preparing
  5. ...
  6. ...
  7. 878dab86cf0f: Waiting
  8. 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/提交图像:

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

字符串
4/最后推它:

  1. 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):

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

字符串

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

相关问题