问题:

    发布镜像的时候,按照教程执行的,结果没有成功,搜了下,找到解决方法了,记录一下。

    

denied: requested access to the resource is denied

解决方法:

看到这个,只好搜索了。还好,有不少帖子都有。看看下面我的执行步骤

PS C:\WINDOWS\system32> docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
learn/ping              latest              6ab895012fc7        About an hour ago   140MB
mreleven/docker-whale   latest              a1096bccdd95        2 years ago         274MB
learn/tutorial          latest              a7876479f1aa        5 years ago         128MB
PS C:\WINDOWS\system32> docker tag learn/ping shoneworn/ping
PS C:\WINDOWS\system32> docker push shoneworn/ping
The push refers to repository [docker.io/shoneworn/ping]
64aad28fc9e6: Pushed
ee1ba0cc9b81: Mounted from learn/ping
latest: digest: sha256:2d9dcd651ff630352be0faad74900ac57415a12809223062377d42c90c50ef8e size: 740
PS C:\WINDOWS\system32> docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
learn/ping              latest              6ab895012fc7        About an hour ago   140MB
shoneworn/ping          latest              6ab895012fc7        About an hour ago   140MB
mreleven/docker-whale   latest              a1096bccdd95        2 years ago         274MB
learn/tutorial          latest              a7876479f1aa        5 years ago         128MB
PS C:\WINDOWS\system32> docker run shoneworn/ping ping www.baidu.com
PING www.a.shifen.com (115.239.210.27) 56(84) bytes of data.
64 bytes from 115.239.210.27: icmp_req=1 ttl=37 time=17.7 ms
64 bytes from 115.239.210.27: icmp_req=2 ttl=37 time=57.4 ms
PS C:\WINDOWS\system32>
1.先列出所有镜像
PS C:\WINDOWS\system32> docker images

2.将要发布的镜像改到自己账户名下。我的账户名:shoneworn

PS C:\WINDOWS\system32> docker tag learn/ping shoneworn/ping

3.再次发布镜像

PS C:\WINDOWS\system32> docker push shoneworn/ping

4.再次查看镜像列表

PS C:\WINDOWS\system32> docker images

5.运行自己账户下的镜像测试

PS C:\WINDOWS\system32> docker run shoneworn/ping ping www.baidu.com

运行结果上图中已经有了。

转载请注明:https://blog.csdn.net/shoneworn


另外,如果你在学习的时候遇到过re-exec error: exit status 1: output: Failed to openRelative failed in Win32: open \\?\C:\ProgramData\Docker\windowsfilter\72f0582a1f68b9f9fd0570832f93051270a78b062edef177f04deecb706fe077\usr\share\man\man7\pam.7.gz: Cannot create a file when that file already exists. (0x1f) usr\share\man\man7\pam.7.gz 

请参考我上一篇提帖子

Docker: Win10 拉取镜像失败failed to register layer: re-exec error: exit status 1: output: Failed to openRe

文章参考自:https://blog.csdn.net/xuming9/article/details/78148229





Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐