问题-随笔
1、harbor报错
- 假设harbor的IP、域名和账密:10.1.1.15:9523 harbor.hengha.cn:9523(admin/password)
1.1、登录harbor报错
- 登录的命令是:echo "password" | docker login 10.1.1.15:9523 --username admin --password-stdin
报错1:
- Error response from daemon: Get "https://10.1.1.15:9523/v2/": http: server gave HTTP response to HTTPS client
//在/etc/docker/daemon.json中添加 ]# vim /etc/docker/daemon.json { "insecure-registries": ["10.1.1.15:9523"] } //重启docker ]# systemctl restart docker
报错2:
- Error response from daemon: Get "http://10.1.1.15:9523/v2/": Get "http://harbor.hengha.cn:9523/service/token?account=admin&client_id=docker&offline_token=true&service=harbor-registry": dial tcp: lookup harbor.hengha.cn on 114.114.114.114:53: no such host
//在/etc/hosts中添加 ]# vim /etc/hosts 10.1.1.15 harbor.hengha.cn
1.2、下载镜像报错
- 下载镜像的命令:docker pull harbor.hengha.cn:9523/oes/busybox:1.28 (在harbor管理页面中获取的该命令)
报错1:
- Error response from daemon: Get "https:// harbor.hengha.cn:9523/v2/": http: server gave HTTP response to HTTPS client
//将域名换成IP ]# docker pull 10.1.1.15:9523/oes/busybox:1.28
1
# #