私有Registry--Harbor安裝

1,安裝docker-compose

rpm -ivh https://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-11.noarch.rpm
yum install docker docker-compose -y

systemctl start docker
systemctl enable docker

2,安裝harbor

# 申請ssl證書,在阿里雲或騰訊雲上申請免費的ssl證書並上傳到服務器
# 放置/data/harbor/ssl_cert目錄下
mkdir /data/harbor/ssl_cert -pv
ls /data/harbor/ssl_cert/
reg.xxxxx.com.crt  reg.xxxxx.com.key
# 在線安裝
下載在線安裝包
https://github.com/goharbor/harbor/releases 
在上述鏈接中下載對應的版本,這裏使用的是1.5.2版本的,可自行下載最新版的
wget https://storage.googleapis.com/harbor-releases/harbor-online-installer-v1.5.2.tgz
tar xvf harbor-online-installer-v1.5.2.tgz
cd harbor
vim harbor.cfg
hostname = reg.xxxxx.com
# 這裏建議使用https協議,免費的ssl證書在阿里雲上很容易就申請到了,因爲不用https協議docker那邊需要修改配置如果是一兩臺docker修改倒也無所謂,多的時候就很麻煩了
ui_url_protocol = https
customize_crt = off
ssl_cert = /data/harbor/ssl_cert/reg.xxxxx.com.crt
ssl_cert_key = /data/harbor/ssl_cert/reg.xxxxx.com.key
# 其他的參數根據需要修改
# end
# 需要注意的是docker-compose必須要安裝,及本機上不能監聽80,443端口
## 修改所有存儲數據目錄爲/data/harbor,默認harbor所屬的組件的數據均存儲在/data目錄下,很不方便,如果本機部署有其他服務的數據也存儲在/data目錄的話 管理會很不方便
docker-compose.yml prepare docker-compose.chartmuseum.yml
# 分別打開上述文件搜索data關鍵字,在每一個/data替換爲/data/harbor 
# 執行安裝腳本
./install.sh
# 直到出現以下信息則表示安裝成功
✔ ----Harbor has been installed and started successfully.----

Now you should be able to visit the admin portal at https://reg.xxxxx.com. 
For more details, please visit https://github.com/vmware/harbor .

更多好文關注馬哥linux運維

私有Registry--Harbor安裝

# 測試
瀏覽器打開https://reg.xxxxx.com 
默認用戶密碼爲 admin/Harbor12345

# 命令行登錄 registry
docker login reg.xxxxx.com
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章