github地址
wget https://githubfast.com/goharbor/harbor/releases/download/v2.11.1/harbor-offline-installer-v2.11.1.tgz
解压
tar xf harbor-offline-installer-v2.11.1.tgz -C /usr/local/
cd /usr/local/harbor
cp harbor.yml.tmpl harbor.yml
vim harbor.yml
修改内容如下,主要涉及 hostname改为ip,http端口可以换掉,https块去掉
hostname: xx.xx.xx.xx
harbor_admin_password: admin
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 88
#https:
# https port for harbor, default is 443
# port: 443
# The path of cert and key files for nginx
# certificate: /your/certificate/path
# private_key: /your/private/key/path
data_volume: /data #这个路径是宿主机的路径,根据实际情况修改成空间大的地方
默认密码 Harbor12345
安装harbor前需要先安装docker和docker-compose,并且启动docker和docker-compose。
安装docker 参考 install/kubernetes/rancher/install_docker.md
cd /usr/local/harbor
./install.sh
docker-compose ps
vi /etc/docker/daemon.json
添加配置
{
"insecure-registries":["xx.xx.xx.xx:88"]
}
重启生效
systemctl stop docker
systemctl daemon-reload
systemctl start docker
在 部署好的 Harbor 中添加 HTTPS 证书配置
x509: cannot validate certificate for 10.30.0.163 because it doesn't contain any IP SANs
最后 Docker login $harborIP,就可以 docker pull 拉取服务。