一、首先下載安裝docker-compose工具
1.使用curl工具下載docker-compose,這種方法賊慢舞肆。
curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
2.直接在官方的github地址 [https://github.com/docker/compose/releases]中焦辅,粘貼路徑[https://github.com/docker/compose/releases/download/1.28.4/docker-compose-Darwin-x86_64]后,使用迅雷下載docker-compose椿胯,速度賊快筷登。
當(dāng)下載好后docker-compose后,敲如下命令哩盲,將docker-compose用起來
mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
cd /usr/local/bin/
chmod +x docker-compose
最后命令行輸入docker-compose -v ,可以看到版本前方,表明docker-compose可以在命令行中使用起來。
二廉油、下載harbor離線包后惠险,修改配置文件,運(yùn)行離線包內(nèi)自帶的安裝腳本
#當(dāng)然抒线,wget這么下還是賊慢班巩,將如下https鏈接復(fù)制到迅雷中下載,就比較快
wget -P /home/harbor/ https://storage.googleapis.com/harbor-releases/release-1.9.0/harbor-offline-installer-v1.9.0.tgz
cd /home/harbor
tar -zxvf harbor-offline-installer-v1.9.0.tgz
最后編輯解壓后的包里面的harbor.yml嘶炭,如果需要使用https訪問抱慌,則修改如下參數(shù),如果不需要旱物,記下yml中的初始密碼就可以在本地瀏覽器中登錄harbor使用了:
# The IP address or hostname to access admin UI and registry service.
# DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
hostname: www.harbor.mb
# http related config
#http:
# port for http, default is 80. If https enabled, this port will redirect to https port
# port: 80
# https related config
https:
# # https port for harbor, default is 443
port: 443
# # The path of cert and key files for nginx
certificate: /data/cert/www.harbor.mb.crt
private_key: /data/cert/www.harbor.mb.key
主要就是設(shè)置https端口號(hào)、hostname和證書地址卫袒,在編輯好harbor.yml后輸入如下命令宵呛,啟動(dòng)harbor倉庫:
./prepare
./install.sh
(停止harbor,使用docker-compose stop)
之后補(bǔ)充,使用openssl配置證書的操作夕凝。