mkdir -p /data
git clone https://github.com/goharbor/harbor.git
cd harbor
git checkout -b v2.2.2 v2.2.2
cd make
cat > download_images.sh << 'EOF'
namespace=cocl666
version=v2.2.2
imgs=(
redis-photon
harbor-db
harbor-jobservice
harbor-log
nginx-photon
registry-photon
harbor-registryctl
notary-signer-photon
notary-server-photon
trivy-adapter-photon
chartmuseum-photon
harbor-exporter
prepare
harbor-portal
harbor-core
)
for img in ${imgs[@]}
do
docker pull $namespace/$img:$version
docker tag $namespace/$img:$version goharbor/$img:$version
done
docker pull $namespace/swagger:v0.21.0
docker tag $namespace/swagger:v0.21.0 goharbor/swagger:v0.21.0
docker save `docker images | grep $version | awk '{print $1":"$2}'` goharbor/swagger:v0.21.0 | gzip > harbor.$version.tar.gz
EOF
bash download_images.sh
sed -i 's#goharbor/prepare:dev#goharbor/prepare:v2.2.2#g' prepare
#使用模板生成harbor.yml
cp harbor.yml.tmpl harbor.yml
harbor.yml 修改几个重要的配置
hostname: harbor.kids.cn
http:
port: 80
https:
harbor_admin_password: Harbor123456
database:
password: root123
data_volume: /data/harbor/data
6、安装启动harbor
./install.sh --with-chartmuseum --with-trivy
|