c创建docker私有仓库
docker pull registry:2.1.1
mkdir /opt/registry
#mkdir /var/lib/registry
docker run -d -p 5000:5000 -v /opt/registry:/var/lib/registry --restart=always --name registry registry:2.1.1
curl http://node2:5000/v2/_catalog
curl -XGET http://192.168.1.46:5000/v2/nginx/tags/list
- # sudo docker push 192.168.61.128:5000/busybox
- The push refers to a repository [192.168.61.128:5000/busybox]
- Get https://192.168.61.128:5000/v1/_ping: http: server gave HTTP response to HTTPS client
出现上述提示,表示本地的仓库默认使用的是https进行上传,如果是非https就会出现以上的提示
解决方式,可以参考一下方式
修改文件/usr/lib/systemd/system/docker.service,在ExecStart=/usr/bin/dockerd后面添加--insecure-registry node2:5000,然后重启docker服务
参考 https://blog.csdn.net/bxzhu/article/details/73253032
https://blog.csdn.net/enter89/article/details/99689609 docker client version:19.03.2 原因分析:docker registry未采用https服务,而客户端docker使用https请求push所致 解决方法:docker客户端将https请求更改为http请求, 将以下配置添加到 /etc/docker/daemon.json 中 { "insecure-registries":["192.168.220.125:5000"] } 重启docker
Harbor安装报错502 Bad Gateway
https://www.qnjslm.com/ITHelp/672.html
查看/var/log/harbor/jobservice.log 日志有以下报错
Dec 25 02:39:50 172.18.0.1 jobservice[2641]: 2017-12-25T07:39:50Z [ERROR] [utils.go:102]: failed to connect to tcp://adminserver:8080, retry after 2 seconds :dial tcp 172.18.0.3:8
080: getsockopt: connection refused
harbor login :443 read: connection reset by peer
[root@node1 ~]# docker login -u littlevigra -p Fu12345678uF node2
Error response from daemon: Get https://node2/v1/users/: read tcp 172.16.5.44:55312->172.16.5.45:443: read: connection reset by peer 解决方法:
vim /etc/systemd/system/docker.service
ExecStart=/usr/bin/dockerd
$DOCKER_OPTS
$DOCKER_STORAGE_OPTIONS
$DOCKER_NETWORK_OPTIONS
$DOCKER_DNS_OPTIONS
--insecure-registry=node2
# $INSECURE_REGISTRY
systemctl daemon-reload
1011 systemctl restart docker
参考: http://www.cnblogs.com/weifeng1463/p/9990741.html