我正在按照这个链接创建我的第一个docker映像,它成功了,现在我试图从这个链接将这个映像推到我的docker存储库中。但是每当我试图将这个映像推入存储库时,我就会得到这种类型的错误。
denied: requested access to the resource is denied
注:我已成功登录docker
我正在按照这个链接创建我的第一个docker映像,它成功了,现在我试图从这个链接将这个映像推到我的docker存储库中。但是每当我试图将这个映像推入存储库时,我就会得到这种类型的错误。
denied: requested access to the resource is denied
注:我已成功登录docker
当前回答
我也有这个问题。事实证明,我使用的是免费层,并试图在私有存储库中推送多个图像。将一张图片设为私有,其余的设为公共,这对我来说很管用。
其他回答
OS: Ubuntu16.04
原因:我删除了客户端配置文件(~/.docker/config.json)
解决方案:
重启码头工人。 服务docker重启。 它需要输入登录信息,然后自动生成配置文件。 Docker login——username=yourdockerhubername——email=youremail@company.com
尝试签出“Docker for Windows”应用程序和签出https://hub.docker.com/网站后执行“Docker登录”和“Docker推送”。 这对我很有帮助。
所以,如果这对任何人有帮助的话… 我有同样的问题,这是我的问题和修复是什么。 我的测试网络上有一台名为“galaxy”的计算机。 我使用以下运行命令设置docker注册表:
sudo docker run -d
--restart=always \
--name registry \
-v /srv/registry/certs:/certs \
-v /srv/registry/storage:/var/lib/registry \
-e REGISTRY_HTTP_ADDR=0.0.0.0:443 \
-e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/galaxy.cert \
-e REGISTRY_HTTP_TLS_KEY=/certs/galaxy.key \
-p 443:443 \
registry:2
然后我试图从网络上的笔记本电脑推送图像到银河系,所以我这样做了:
docker login galaxy
这将给我一个错误,它会说:
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 tag myImage:0.0.1 galaxy:443/myImage:0.0.1
... 然后像这样推:
docker push galaxy:443/myImage:0.0.1
因此,出于某种原因,我不得不将端口作为存储库名称的必要部分包含在标记中。
希望这能帮助到其他人。
如果您已经登录,如果您仍然得到错误。请按照步骤操作,
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
您可能需要在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