1.配置本地域名方式
vim /etc/docker/daemon.json
{
"insecure-registries":["localharbor:30102","10.224.0.220:30102"]
}
vim /etc/hosts
10.224.0.220 localharbor
2.添加私库
{
"registry-mirrors": ["http://10.224.0.220:30102"],
"insecure-registries":["10.224.0.220:30102"]
}
生成目标镜像只需默认项目名即可,无需 Domain:Port/library/* 或 IP:Port/library/* 前缀
3.重启
systemctl daemon-reload
systemctl restart docker
特别提醒:webhook的url路径中不能带点,否则无法自动触发镜像构建