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 login
<enter user name and password for Docker Hub Repository>
$ docker tag first-image {docker-hub-username}/{default-repo-folder-name}:first-image
$ docker push {docker-hub-username}/{default-repo-folder-name}:first-image
例如,我有像manjeet86/docker-repo这样的公共存储库,所以命令将是:
$ docker tag first-image manjeet86/docker-repo:first-image
$ docker push manjeet86/docker-repo:first-image
Login did not succeed, error: Error response from daemon:
Get https://galaxy/v2/: x509: certificate signed by unknown authority
奇怪的是,解决这个问题的方法是这样登录:
docker login galaxy:443
这导致成功登录。
然后我试图将图像从我的笔记本电脑推送到“银河”。
我已经为我的图像创建了一个标签,看起来像这样:
galaxy/myImage:0.0.1
所以我试着推动它这样做:
docker push galaxy/myImage:0.0.1
对此我得到了回复:
The push refers to repository [docker.io/galaxy/myImage]
7ab460574f86: Preparing
1aecaf56754d: Preparing
1df1b5f06ca4: Preparing
denied: requested access to the resource is denied
当直接从终端使用时,命令docker login成功地询问了我的凭据,并且在我正确输入它们之后(请记住没有电子邮件,只有docker ID才能工作),它宣布login succeeded,但任何推送请求都将以denied: requested access to the resource is denied结束
在我的例子中,我的管道在docker push之后触发了一个清理作业(doctl registry garbage-collection start),它将注册表置于只读模式(参见doc)。因此,当清理作业处于活动状态时,下一次推送将获得denied: requested access to the resource is denied。
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