提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
文章目录
一、Harbor是什么?
Harbor 是由 VMware 公司中国团队为企业用户设计的 Registry server 开源项目,包括了权限管理 (RBAC)、LDAP、审计、管理界面、自我注册、HA 等企业必需的功能,同时针对中国用户的特点,设计镜像复制和中文支持等功能。
作为一个企业级私有 Registry 服务器,Harbor 提供了更好的性能和安全。提升用户使用 Registry 构建和运行环境传输镜像的效率。Harbor 支持安装在多个 Registry 节点的镜像资源复制,镜像全部保存在私有 Registry 中, 确保数据和知识产权在公司内部网络中管控。另外,Harbor 也提供了高级的安全特性,诸如用户管理,访问控制和活动审计等
二、安装步骤
1.安装docker
wget -qO- https://get.docker.com | sh
2.启动docker
systemctl start docker
3.添加docker为启动项
systemctl enable docker
4.配置镜像加速
vi /etc/docker/daemon.json
{
"registry-mirrors" : ["https://docker.mirrors.ustc.edu.cn"]
}
4.docker-compose安装
curl -L "https://github.com/docker/compose/releases/download/1.28.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
赋予执行权限
chmod +x /usr/local/bin/docker-compose
5.下载Harbor安装包
https://github.com/goharbor/harbor/releases
上传到服务器制定位置
6.解压、配置
tar -zxvf harbor-offline-installer-v2.5.1.tgz
修改hostname 注释掉https,其他可以先不改
hostname: 10.18.23.51
http:
# port for http, default is 80. If https enabled, this port will redirect to https port
port: 80
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
7.启动
./prepare
./install.sh
访问
http://xx.xx.xx.xx/
默认密码在配置文件中,没有改动的话是admin/Harbor12345