docker报错:denied: requested access to the resource is denied unauthorized: authentication required

errors:
denied: requested access to the resource is denied
unauthorized: authentication required。

解决方案

  • 修改发布的镜像的REPOSITORY为自己的账户名+镜像,比如我的用户名是123456。
docker tag  nginx  123456/nginx:1.0

docker报错:denied: requested access to the resource is denied unauthorized: authentication required

  • 然后发布镜像
docker push 123456/nginx:1.0 

然后打开私人仓库就可以了。

docker报错:denied: requested access to the resource is denied unauthorized: authentication required

当然了。此时就出现了一个问题:出现了相同的镜像,我们肯定不想要太多的镜像。那么怎么删除呢?

docker rmi 7e4d58f0e5f3? 不好意思。报错

Error response from daemon: conflict: unable to delete 7e4d58f0e5f3 (must be forced) - image is referenced in multiple repositories

分析原因:

一个镜像ID出现了两个镜像,系统肯定不知道删除哪一个。

解决方案:

使用REPOSITORY:TAG结合来删除。

比如:docker rmi 7e4d58f0e5f3:1.0

docker报错:denied: requested access to the resource is denied unauthorized: authentication required