【Linus搭建Harbor環境】
阿新 • • 發佈:2020-07-16
目錄
一、安裝前準備
1.1安裝Docker
- docker -v
1.2安裝docker-compose
- sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- docker-compose --version
二、安裝
2.1 下載安裝包
2.2 解壓安裝包
- tar -zxvf harbor-offline-installer-v1.2.2.tgz
2.3 修改配置檔案
cd harbor && vi harbor.cfg
hostname = A.B.C.D #harbor伺服器地址
2.4 修改Docker配置
- vi /etc/docker/daemon.json #docker login預設是https訪問, 配置連線harbor地址 http可訪問(沒有則建立該檔案)
{
"insecure-registries": [
"192.168.137.132"
]
}
- systemctl restart docker #重啟docker
2.5 安裝Harbor
- cd harbor && ./install.sh
2.6 登入Harbor
登入地址:http://A.B.C.D 使用者名稱:admin 密碼:Harbor12345
新建私有專案my-harbor-test
2.7 推送本地映象到Harbor倉庫
- docker tag elasticsearch:6.4.0 A.B.C.D/my-harbor-test(建立的專案名稱)/elasticsearch:6.4.0
- docker login A.B.C.D -u admin -p Harbor12345
- docker push A.B.C.D/my-harbor-test/elasticsearch:6.4.0