Harbor是企業級的私有Docker Repository,提供管理使用者介面、角色存取控制等企業級特性。
安裝
更新apt
sudo apt-get update
安裝https的支援工具
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common -y
增加GPG Key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add
再次更新apt
sudo apt-get update
安裝Docker-ce
sudo apt-get install docker-ce
安裝Docker-Compose
sudo curl -L "https://github.com/docker/compose/release/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
調整權限
sudo chmod +x /usr/local/bin/docker-compose
下載Harbor
wget https://github.com/goharbor/harbor/releases/download/v2.0.0/harbor-online-installer-v2.0.0.tgz
解壓縮tgz檔
tar xvf harbor-online-installer-v2.0.0.tgz
修改harbor.yml
- hostname
- port
- admin password
執行安裝檔
sudo ./install.sh
設定開機自動啟動
編輯系統檔
vi /etc/rc.local
增加內容
cd /usr/local/harbor && docker-compose up -d