前置条件需要docker-compose 1.18+
安装docker-compose 1.27
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
1. Github下载Harbor
下载并解压
wget https://github.com/goharbor/harbor/releases/download/v2.2.0/harbor-offline-installer-v2.2.0.tgz
tar -xf harbor-offline-installer-v2.2.0.tgz
2. 修改harbor.yml.tml配置文件
#服务器IP或者域名
hostname: 192.168.80.10
# web界面的端口
http:
port: 10080
# 默认admin的密码
harbor_admin_password: Harbor12345
#注释以下内容,除非有https证书
#https:
# https port for harbor, default is 443
# port: 443
# The path of cert and key files for nginx
# certificate: /your/certificate/path
# private_key: /your/private/key/path
3. 安装Harbor
sudo ./install.sh
安装完成后harbor目录下生成docker-compose.yml的配置文件
故障处理
1. docker未添加镜像仓库源
修改daemon.json,添加镜像仓库
sudo vim /etc/docker/daemon.json
{
"insecure-registries": ["10.1.15.132:10080"]
}
重启docker
systemctl restart docker.service
2.
sudo apt install gnupg2 pass