一、私仓建立参考:
步骤:https://blog.csdn.net/qwerty1372431588/article/details/113095997?utm_medium=distribute.pc_relevant.none-task-blog-2defaultbaidujs_baidulandingword~default-5-113095997-blog-105926147.235v40pc_relevant_3m_sort_dl_base4&spm=1001.2101.3001.4242.4&utm_relevant_index=8
调试bug:
问题1:Docker自从1.3.X之后docker registry交互默认使用的是HTTPS
1.vim /etc/docker/daemon.json 增加一个daemon.json文件
{ "insecure-registries":["192.168.1.100:5000"] }
问题2:https://blog.csdn.net/weixin_46660849/article/details/134407856
问题的关键是要在生成SSL证书的时候添加:-addext “subjectAltName = DNS:<你的域名>”,具体操作如下:
:注意写域名,生成证书过程中,
Common Name (e.g. server FQDN or YOUR name) []:reg.westos.org
问题3:ubuntu下安装命令:htpasswd
apt install apache2-utils
问题4:查询镜像方式:
https://reg.westos.org/v2/_catalog
账号密码: zhy/1234
查看命令:
查看
curl -X GET https://172.16.200.228:433/v2/_catalog
启动
用户启动
docker run -d --name registry -p 443:443 -v /opt/registry:/var/lib/registry -v "$(pwd)"/certs:/certs -e REGISTRY_HTTP_ADDR=0.0.0.0:443 -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/westos.org.crt -e REGISTRY_HTTP_TLS_KEY=/certs/westos.org.key -v "$(pwd)"/auth:/auth -e "REGISTRY_AUTH=htpasswd" -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd registry
二、harbor搭建
参考:https://blog.csdn.net/u012751272/article/details/118859088?utm_medium=distribute.pc_relevant.none-task-blog-2defaultbaidujs_baidulandingword~default-8-118859088-blog-127732870.235v40pc_relevant_3m_sort_dl_base4&spm=1001.2101.3001.4242.5&utm_relevant_index=11
使用虚拟机搭建:
地址:
172.16.200.225
账号密码:
harbor.chenbyx.cn
admin
Harbor12345
密码:124asdfF
另外宿主机,登录harbor
1、hosts文件
2、daemon.json. 非安全访问。重启服务。文件位置:/etc/docker/daemon.json
{
"insecure-registries":["172.16.200.225:5000"],
"insecure-registries":["https://harbor.chenbyx.cn"]
}
账户文件
.docker/config.json
talos 仓库备用:
https://harbor.chenbyx.cn/harbor/projects/4/repositories
harbor 安装路径:/usr/local/harbor
卸载步骤
-
docker rm -f $(docker ps -aq)
-
rm -rf
find / -name harbor