#安装docker $ yum install docker # 安装docker ... $ systemctl start docker # 运行docker服务 $ yum install docker-compose #需要安装docker-compose
#新下载地址 wget https://github.com/goharbor/harbor/releases/download/v1.9.4/harbor-offline-installer-v1.9.4.tgz
#https配置参考
https://github.com/goharbor/harbor/blob/v1.9.4/docs/configure_https.md
#解压harbor $ tar zxvf harbor-offline-installer-v1.9.4.tgz $ cd harbor $ mkdir ssl $ cd ssl/ #生成key openssl genrsa -out ca.key 4096 #生成证书 openssl req -x509 -new -nodes -sha512 -days 3650 -subj "/C=TW/ST=Taipei/L=Taipei/O=example/OU=Personal/CN=yourdomain.com" -key ca.key -out ca.crt
#修改配置文件 $ vi Harbor.yml #生成Harbor的配置文件: $./prepare #安装 $ sudo ./install.sh #具体配置参考: https://github.com/goharbor/harbor/blob/v1.9.4/docs/installation_guide.md
#yourdomain.com域名需要配置host
#配置域名host $ vi /etc/hosts #创建证书验签目录 mkdir /etc/docker/certs.d/yourdomain.com -p #拷贝证书crt到这个目录下 $scp root@111.11.1.1.1:/root/harbor/ssl/yourdomain.com.crt /etc/docker/certs.d/yourdomain.com
#登陆到harbor $ docker login yourdomain.com #查看本地镜像 $ docker images #打tag $ docker tag tomcat:v1 yourdomain.com/test/tomcat:v1 #上传 $ docker push yourdomain.com/test/tomcat:v1
.
原文:https://www.cnblogs.com/CGCong/p/12221969.html