简体   繁体   English

如何将图像推送到 Docker 集线器

[英]How to push image to Docker Hub

I can't push my local image to Docker hub.我无法将本地图像推送到 Docker 集线器。 I checked every topics in here but still couldn't solve it.我检查了这里的每个主题,但仍然无法解决。

My local image is like below;我的本地图像如下所示;

[root@DOCKER2Demo]# docker images
REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
companyrepo123/man-demo        latest                b86sbfd26        41 minutes ago      5.31GB

So I want to push this image to the "companyrepo123/man-demo:latest" repository.所以我想将此图像推送到“companyrepo123/man-demo:latest”存储库。

So I login successfully with "docker login" and run the command below所以我用“docker login”成功登录并运行下面的命令

docker push companyrepo123/man-demo:latest

But gives the error below;但给出以下错误;

The push refers to repository [docker.io/companyrepo123/man-demo]
82bb2b81506d: Preparing
0ae79b7db02c: Preparing
df9824e71502: Preparing
d384c5326457: Preparing
da1504cd9d9b: Preparing
976e766378b6: Waiting
8154f91c38f9: Waiting
a74cf09880c3: Waiting
1c0efef42405: Waiting
1417e6a7c4fd: Waiting
79ac04ef09ff: Waiting
77b174a6a187: Waiting
denied: requested access to the resource is denied

I already login.我已经登录了。 Tried to logout and login and but still same.尝试注销并登录,但仍然相同。

Please noticed that my username is not "companyrepo123".请注意我的用户名不是“companyrepo123”。 This is our company's repository, my username to login Docker hub is "yatta".这是我们公司的存储库,我登录 Docker 集线器的用户名是“yatta”。

How can I push that image?我怎样才能推送该图像?

Regards.问候。

You need to push to a repository under your namespace in Docker Hub, where the first part of that path is your username or organization.您需要推送到 Docker Hub 中您的命名空间下的存储库,其中该路径的第一部分是您的用户名或组织。 So myrepo123 would be your username.所以myrepo123将是您的用户名。

Next, you'll want to create the repository, myrepo123/man-demo on Docker Hub (from the web interface), and if this is under an organization, make sure your user has access to push to that repo within the organization.接下来,您需要在 Docker 集线器(来自 web 界面)上创建存储库myrepo123/man-demo ,如果这是在组织下,请确保您的用户有权在组织内推送到该存储库。

If you've done that, then make sure you have logged into Docker Hub, with the correct username, using:如果您已完成此操作,请确保您已使用正确的用户名登录 Docker 集线器,使用:

docker login

If you have enabled 2fa on Hub, the password for this is an access token you generate from the web page.如果您在 Hub 上启用了 2fa,则此密码是您从 web 页面生成的访问令牌。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM