k8s离线部署学习-Harbor仓库部署
程序员文章站
2022-07-13 21:11:53
...
**注意:**部署在存储节点
下载离线包
Harbor:https://github.com/goharbor/harbor/releases
docker-compose:https://github.com/docker/compose/releases
解压
tar -xvf harbor-offline-installer-v2.3.2.tgz
修改配置
cp harbor.yml.tmpl harbor.yml
vim harbor.yml
修改hostname,port,注释https,如下:
hostname: 10.0.7.125
# http related config
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 8000
# https related config
#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
...
data_volume: /data/harbor
安装
安装docker-compose
cp docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
安装harbor
docker load -i harbor.v2.3.2.tar.gz
./prepare
./install.sh
添加信任
vim /etc/docker/daemon.json
# 添加
"insecure-registries": ["10.0.7.125:8000"]
# 重启docker
systemctl daemon-reload
systemctl restart docker
测试
登录
docker login -u admin 10.0.7.125:8000
# 密码
# Harbor12345
tag
docker tag nginx:1.18 10.0.7.125:8000/library/nginx:1.18
push
docker push 10.0.7.125:8000/library/nginx:1.18
上一篇: k8s部署-6.node节点组件
下一篇: TIM1输入捕获测量方波信号周期