wget https://github.com/goharbor/harbor/releases/download/v2.4.3/harbor-offline-installer-v2.4.3.tgz
解压到/
cd opt/harbor/
vi harbor.yml
hostname: harbor.xxx.com 改为域名
external_url: https://harbor.xxx.com #此处nginx代理配置了HTTPS后,其他服务器登录提示跳转地址加了端口号
port: 2280 此处改为实际端口
禁止443
./prepare
./install
docker push到harbor私库中报unknown blob错误
/etc/docker/daemon.json中增加
{"registry-mirrors": ["https://dockerhub.azk8s.cn","https://reg-mirror.qiniu.com","https://registry.docker-cn.com"],
"insecure-registries": ["hub.cdysxy.cn"]
}
##"insecure-registries": ["hub.cdysxy.cn"],解决docker login登录失败Error response from daemon: Get https://hub.cdysxy.cn/v2/: Get http://hub.cdysxy.cn:2280
systemctl daemon-reload && systemctl restart docker
harbor容器需要重新./install
error parsing HTTP 413 response body: invalid character '<' looking for beginning of value: "<html>\r\n<head><title>413 Request Entity Too Large</title></head>\r\n<body>\r\n<center><h1>413 Request Entity Too Large</h1></center>\r\n<hr><center>nginx/1.20.2</center>\r\n</body>\r\n</html>
nginx中proxy_set_header Host $host;这行需注释
echo "net.ipv4.ip_forward=1" >>/etc/sysctl.conf
vim /etc/sysctl.conf
#配置转发
net.ipv4.ip_forward=1
#保存退出就可以了
:wq!
#重启服务,让配置生效
systemctl restart network
#查看是否成功,如果返回为“net.ipv4.ip_forward = 1”则表示成功
sysctl net.ipv4.ip_forward