前言
搭建的 harbor
仓库为 http
协议,在本地登录时出现如下报错:
docker login http://192.168.xx.xx
Username: admin
Password:
Error response from daemon: Get "https://192.168.xx.xx/v2/": dialing 192.168.xx.xx:443 matches static system exclude: connecting to 192.168.xx.xx:443: dial tcp 192.168.xx.xx:443: connect: connection refuseddocker login http://192.168.xx.xx:80
Username: admin
Password:
Error response from daemon: Get "https://192.168.xx.xx:80/v2/": http: server gave HTTP response to HTTPS client
解决方法
修改 /etc/docker/daemon.json
,添加 "insecure-registries"
{"builder": {"gc": {"defaultKeepStorage": "20GB","enabled": true}},"experimental": false,"insecure-registries": ["http://192.168.xx.xx:80"], // 新增这一行"registry-mirrors": ["https://1nj0zren.mirror.aliyuncs.com","https://docker.mirrors.ustc.edu.cn","http://f1361db2.m.daocloud.io","https://registry.docker-cn.com"]
}
再次尝试登录
docker login http://192.168.xx.xx:80
Username: admin
Password:
Login Succeeded
登录成功!