我正在按照这个链接创建我的第一个docker映像,它成功了,现在我试图从这个链接将这个映像推到我的docker存储库中。但是每当我试图将这个映像推入存储库时,我就会得到这种类型的错误。
denied: requested access to the resource is denied
注:我已成功登录docker
我正在按照这个链接创建我的第一个docker映像,它成功了,现在我试图从这个链接将这个映像推到我的docker存储库中。但是每当我试图将这个映像推入存储库时,我就会得到这种类型的错误。
denied: requested access to the resource is denied
注:我已成功登录docker
当前回答
使用以下命令:
$ 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
你看:而不是/这就是窍门。这对我很管用。我不知道它是否让你用/来代替:,但这可能是出于其他目的。
https://docs.docker.com/engine/reference/commandline/tag/#examples
其他回答
有一个docker文件,要求是立即构建一个映像并将其推送到docker hub
登录Docker集线器 Sudo docker login -u your_username 输入密码 构建映像 Sudo docker build -t your_username/demorepo:1.0 上面没有提到图像名称,因为your_username/demorepo是一个 在docker中心回购。标签名称为1.0 推送图片 Sudo docker推送your_username/demorepo:1.0
将已经存在的图像推送到Docker中心
Login to the Docker hub sudo docker login -u your_username Enter password Tag your image(suppose your image is named as test_docker:1.0) sudo docker tag test_docker:1.0 your_username/demorepo:firstpush Above, firstpush is the tag name given to your image, test_docker with 1.0 Tag. IMPORTANT : (While tagging, the image name is not mentioned) Now in docker images you will have 2 images, one says test_docker 1.0 and the other your_username/demorepo firstpush Push the image sudo docker push your_username/demorepo:firstpush
我知道这个问题已经有很多答案了,但没有一个对我有帮助。
我观察到的是,构建映像非常快,并将其推到docker。IO导致错误:
denied: requested access to the resource is denied
我还注意到做一个
docker image ls
显示我的图像的最新构建是几天前的。
我必须做一个
docker container prune
来摆脱停止的容器,和一个
docker image prune -a
为了摆脱旧的形象。 然后我就可以成功地建立和推广我的形象。
'denied:对资源的请求访问被拒绝'不是来自docker。我是本地码头工人。有趣的是,它在构建过程中并没有失败。
如果在使用Azure容器注册表时遇到此问题,可以先登录到注册表来解决。
docker login yourregistry.azurecr.io
然后标记您的映像以匹配注册表的主机名。
docker image tag yourimagename:[version] yourregistry.azurecr.io/yourimagename:[version]
最后按一下。
docker push yourregistry.azurecr.io/yourimagename:[version]
以防其他人遇到这种情况-在我的情况下,原因是我正在使用(已弃用的)docker合成方法来推送图像。切换到预期的docker推送为我解决了这个问题。
DR docker登录在macOS上不工作,但从应用程序的docker登录工作
当直接从终端使用时,命令docker登录成功地要求我的凭据,在我正确输入它们之后(记住没有电子邮件,只有docker ID将工作),它宣布登录成功,但任何推送请求将以拒绝告终:请求访问资源被拒绝
然而,当我从正在运行的macOs docker应用程序登录时(工具栏中的图标),它工作了。因此,docker登录和运行的docker应用程序/守护进程之间可能会有一些不一致