3.1 部署环境
主机名 |
角色 |
ip地址 |
pg60-200.k8s.host.com |
docker-compose |
10.20.60.200 |
3.2 下载安装二进制软件包
# GitHub仓库地址:https://github.com/goharbor/harbor
shell> cd /usr/local/src
shell> wget https://github.com/goharbor/harbor/archive/v1.8.6.tar.gz
shell> tar zxf harbor-offline-installer-v1.8.6.tgz -C /opt/
3.3 优化内核参数
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
shell> sysctl -p
shell> lsmod |grep br_netfilter
br_netfilter 22209 0
bridge 136173 1 br_netfilter
3.4 配置
- 编辑 /opt/harbor/harbor.yml 文件,修改下面的参数值:
hostname: harbor.k8s.91donkey.com
data_volume: /export/harbor/data
location: /export/harbor/logs
3.5 安装docker-compose
shell> yum -y install docker-compose
shell> rpm -qa docker-compose
docker-compose-1.18.0-4.el7.noarch
3.6 安装harbor
shell> mkdir -p /export/harbor/{data,logs}
shell> cd /opt/harbor
shell> ./install.sh
3.7 检查harbor启动情况
3.8 浏览器访问harbor
3.9 创建私有仓库,拉取可能会用到的公共镜像。
docker pull centos:7
docker pull nginx:1.18.0
docker pull kubernetes/pause:latest
docker pull alpine:3.12.0
docker tag b5b4d78bc90c harbor.k8s.91donkey.com/library/centos:7
docker tag 8fcf4560562d harbor.k8s.91donkey.com/library/nginx:1.18.0
docker tag f9d5de079539 harbor.k8s.91donkey.com/library/pause:latest
docker tag a24bb4013296 harbor.k8s.91donkey.com/library/alpine:3.12.0
docker push harbor.k8s.91donkey.com/library/nginx:1.18.0
docker push harbor.k8s.91donkey.com/library/centos:7
docker push harbor.k8s.91donkey.com/library/pause:latest
docker push harbor.k8s.91donkey.com/library/alpine:3.12.0