環境信息:
操作系統 | 主機名 | IP地址 |
---|---|---|
CentOS7.6 | harbor | 192.168.61.238 |
Harbor 安裝部署
官方發佈地址:<https://github.com/goharbor/harbor/releases>
程序版本依賴:docker-ce docker-compose 1.18.0+ .
Harbor支持在線安裝及離線安裝,此文章採用在線離線安裝的形式,且安裝版本爲1.8.3。
一、下載安裝程序
# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
# yum install -y yum-utils
# yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# yum install docker-compose -y
# yum install docker-ce –y
# systemctl enable docker
# systemctl start docker
# 下載
# wget https://storage.googleapis.com/harbor-releases/release-1.8.0/harbor-offline-installer-v1.8.3.tgz
# 解壓
# tar -zxvf harbor-offline-installer-v1.8.3.tgz
#
二、配置
配置參數位於文件harbor.yml中。
可根據自己的需求設定。
這裏的https證書是我在騰訊雲申請的免費SSL證書,你如果在騰訊雲註冊有域名也可以在這裏 <https://console.cloud.tencent.com/ssl> 直接申請,當然你也可以使用免費證書的申請。
也可以自簽證書:
openssl req -x509 -nodes -days 36500 -newkey rsa:2048 -keyout /date/cert/server.key -out
/date/cert/server.crt
hostname: 192.168.61.238
# https related config
https:
port: 443
certificate: /data/cert/server.crt
private_key: /data/cert/server.key
harbor_admin_password: youpassword
# The default data volume
data_volume: /data/harbor/data
三、安裝
./install