Docker推送镜像到Harbor报错:unauthorized: unauthorized to access repository: test02/hello-xxxxxxxxxxxxxxxxxx

天行健,君子以自强不息;地势坤,君子以厚德载物。


每个人都有惰性,但不断学习是好好生活的根本,共勉!


文章均为学习整理笔记,分享记录为主,如有错误请指正,共同学习进步。

文章目录

  • 场景
  • 报错
  • 解决


场景

Docker推送镜像到Harbor镜像仓库,报错

报错

报错内容如下

[root@k8s-master ~]# docker push 196.30.0.111:8443/test02/hello-world-hs-pu:20240130
The push refers to repository [196.30.0.111:8443/test02/hello-world-hs-pu]
ac28800ec8bb: Preparing 
unauthorized: unauthorized to access repository: test02/hello-world-hs-pu, action: push: unauthorized to access repository: test02/hello-world-hs-pu, action: push

报错截图如下
在这里插入图片描述

解决

根据unauthorized: unauthorized to access repository可知原因为未授权
在docker中登录harbor账号即可解决

docker login 196.30.0.111:8443 -u admin -p Harbor12345

或交互方式登录

docker login 196.30.0.111:8443

输入账号密码

注:如harbor配置过域名可将以上命令中的ip+端口换成域名进行登录
Docker推送镜像到Harbor报错:unauthorized: unauthorized to access repository: test02/hello-xxxxxxxxxxxxxxxxxx_第1张图片
登录成功后再次推送镜像到仓库
在这里插入图片描述


感谢阅读,祝君暴富!

你可能感兴趣的:(Debug笔记,#,Docker,docker,容器,运维,java,linux)