action: push: unauthorized to access repository

在配置完Harbor 后发现push 功能不可用出现以下问题

unauthorized: unauthorized to access repository: xuegod-web/redis-photon, action: push: unauthorized to access repository: xuegod-web/redis-photon, action: push

查找配置文件

[root@win21 ~]# find / -name config.json
。。。
/root/.docker/config.json
/var/lib/pcp/pmdas/json/config.json

发现/root/.docker/config.json 中设在为IP地址而在daemon.json 设的为主机名,更改为同样设置,以下标斜体的

[root@win21 .docker]# cat config.json
{
    "auths": {
        "win21.inno.com": {
            "auth": "YWRtaW46TGVub3ZvQDIwMjA="
        }
    }
}
[root@win21 .docker]# cat /etc/docker/daemon.json 
{
"insecure-registries":["win21.inno.com"]
}

再次尝试,成功

[root@win21 .docker]# docker push win21.inno.com/xuegod-web/redis-photon:v2.1.3
The push refers to repository [win21.inno.com/xuegod-web/redis-photon]
5b2a87b87d06: Pushed 
24b9420d082c: Pushed 
f5d31a9d7d81: Pushed 
8faeb4338473: Pushed 
72021dc640d8: Pushed 
v2.1.3: digest: sha256:d44deb5f862c566755d2a6a185206bb57169be824cfdcc84c740b9b76e6f9ab6 size: 1366

 

posted on 2021-01-08 22:50  InnoLeo  阅读(12771)  评论(5编辑  收藏  举报