Loading

harbor之HTTPS安装

1.下载解压
# tar -xvf harbor-offline-installer-v1.7.6.tgz
# cd /harbror
2.下载python2.7 
# apt install python2.7 && apt install python-pip
3.安装docker 
附上脚本!
#!/bin/bash
# step 1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# Step 4: 更新并安装Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce  docker-ce-cli
# 安装docker-compose并给添加执行权限
4.安装docker-compose
# curl -L https://github.com/docker/compose/releases/download/1.23.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
# chmod +x /usr/local/bin/docker-compose
5.生成证书
# pwd
# /usr/local/src/harbor
# mkdir certs/
生成私有Key
# openssl genrsa -out /usr/local/src/harbor/certs/harbor-ca.key
Generating RSA private key, 2048 bit long modulus (2 primes)
..................................................................................................................+++++
............................................................+++++
e is 65537 (0x010001)
签证
# openssl req -x509 -new -nodes -key /usr/local/src/harbor/certs/harbor-ca.key -subj "/CN=harbor.yuye.net" -days 7120 -out /usr/local/src/harbor/certs/harbor-ca.crt

# vim harbor.cfg
hostname = harbor.yuye.net
ui_url_protocol = https
ss_cert = /usr/local/src/harbor/certs/harbor-ca.crt
ss_cert_key = /usr/local/src/harbor/certs/harbor-ca.key
harbor_admin_password = 123456

# ./prepare 
# bash install.sh

安装完成后,有DNS解析更好不过,无DNS解析,需在本地添加hosts解析。
安装完成

 

posted @ 2021-05-28 15:44  梨花海棠  阅读(157)  评论(0编辑  收藏  举报