1.使用Harbor搭建了内部docker仓库,开始可以往harbor push image,登陆了其他账号再推送的时候,提示:
docker push 192.xxx.xxx.xxx/library/ping:latest
The push refers to repository [192.xxx.xxx.xxx/library/ping]
5f70bf18a086: Preparing
d124781fc06a: Preparing
denied: requested access to the resource is denied
解决方法:
vim ~/.docker/config.json
找到auth,删除图中auth的键值对(或者直接删掉),重新docker login登陆输入用户密码授权。
[root@k8s-master ~]# docker login 192.xxx.xxx.xxx
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
[root@k8s-master ~]# docker push 192.xxx.xxx.xxx/library/ping
The push refers to repository [192.xxx.xxx.xxx/library/ping]
5f70bf18a086: Pushed
d124781fc06a: Pushed
latest: digest: sha256:1968494101768d65272024167bddaf0f9633032c2xxx size: 941
原因猜测:harbor上传library权限配置问题。