• 05 | Harbor的简介下载及安装


    1 Harbor简介

    Harbor是由VMWare公司开源的容器镜像仓库。实际上,Harbor是在Docker Registry上进行相应的企业级扩展,从而获得了更加广泛的应用。

    组件功能
    harbor-adminserver配置管理中心
    harbor-dbmysql数据库
    harbor-jobservice负责镜像复制
    harbor-log记录操作日志
    harbor-uiweb管理页面和API
    nginx前端代理
    redis会话
    registry镜像存储

    2 Harbor下载

    官网地址:

    https://vmare.github.io/harbor/cn/

    3 Harbor安装

    3.1 在线安装

    从docker hub下载harbor相关镜像,安装软件包非常小。

    3.2 离线安装

    安装包包含部署的相关镜像,安装包较大。

    3.3 OVA安装程序

    当用户有vCenter环境时,使用此安装程序,再部署OVA后启动Harbor。

    3.4 具体操作

    3.4.1 先同步时间

    ntpdate  time.windows.com
    
    • 1

    3.4.2 安装

    3.4.2.1 上传docker-compose

    # chmod +x docker-compose-Linux-x86_64 
    # 
    # mv docker-compose-Linux-x86_64 /usr/bin/docker-compose
    
    • 1
    • 2
    • 3

    3.4.2.2 解压harbor

    # tar zxvf harbor-offline-installer-v1.6.1.tgz
    
    • 1

    解压结果:

    harbor/common/templates/
    harbor/common/templates/nginx/
    harbor/common/templates/nginx/nginx.https.conf
    harbor/common/templates/nginx/notary.server.conf
    harbor/common/templates/nginx/nginx.http.conf
    harbor/common/templates/nginx/notary.upstream.conf
    harbor/common/templates/notary/
    harbor/common/templates/notary/notary-signer.crt
    harbor/common/templates/notary/signer-config.json
    harbor/common/templates/notary/notary-signer-ca.crt
    harbor/common/templates/notary/signer_env
    harbor/common/templates/notary/server_env
    harbor/common/templates/notary/signer-config.postgres.json
    harbor/common/templates/notary/server-config.json
    harbor/common/templates/notary/notary-signer.key
    harbor/common/templates/notary/server-config.postgres.json
    harbor/common/templates/adminserver/
    harbor/common/templates/adminserver/env
    harbor/common/templates/chartserver/
    harbor/common/templates/chartserver/env
    harbor/common/templates/db/
    harbor/common/templates/db/env
    harbor/common/templates/registry/
    harbor/common/templates/registry/root.crt
    harbor/common/templates/registry/config.yml
    harbor/common/templates/registryctl/
    harbor/common/templates/registryctl/env
    harbor/common/templates/registryctl/config.yml
    harbor/common/templates/log/
    harbor/common/templates/log/logrotate.conf
    harbor/common/templates/jobservice/
    harbor/common/templates/jobservice/env
    harbor/common/templates/jobservice/config.yml
    harbor/common/templates/core/
    harbor/common/templates/core/env
    harbor/common/templates/core/private_key.pem
    harbor/common/templates/core/app.conf
    harbor/common/templates/clair/
    harbor/common/templates/clair/postgres_env
    harbor/common/templates/clair/config.yaml
    harbor/common/templates/clair/postgresql-init.d/
    harbor/common/templates/clair/postgresql-init.d/README.md
    harbor/common/templates/clair/clair_env
    harbor/harbor.v1.7.5.tar.gz
    harbor/prepare
    harbor/LICENSE
    harbor/install.sh
    harbor/harbor.cfg
    harbor/docker-compose.yml
    harbor/open_source_license
    harbor/docker-compose.notary.yml
    harbor/docker-compose.clair.yml
    harbor/docker-compose.chartmuseum.yml
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53

    3.4.2.3 执行prepare

    # ./prepare
    
    • 1

    在这里插入图片描述

    3.4.2.4 修改harbor的配置文件

    # cd harbor
    # vi harbor.cfg
    hostname = 192.168.xx.xx
    ui_url_protocol = http
    
    • 1
    • 2
    • 3
    • 4

    在这里插入图片描述

    3.4.2.5 install

    # ./install.sh
    
    • 1

    在这里插入图片描述
    在这里插入图片描述

    在这里插入图片描述

    3.4.2.6 查看日志

    ls /var/log/harbor
    在这里插入图片描述

    3.4.2.7 访问

    4 Harbor基本使用

    4.1 配置http镜像仓库可信任

    # vi /etc/docker/daemon.json 
    {"insecure-registries":["reg.ctnrs.com"]}
    
    • 1
    • 2
    # systemctl restart docker
    
    • 1

    4. 2 打标签

    # docker tag centos:6 reg.ctnrs.com/library/centos:6
    
    • 1

    4.3 上传

    # docker push reg.ctnrs.com/library/centos:6
    
    • 1

    4.4 下载

    # docker pull reg.ctnrs.com/library/centos:6
    
    • 1
  • 相关阅读:
    MAC和安卓手机文件传输OpenMTP
    nginx $uri导致的CRLF注入漏洞
    Java多线程编程【一文全解】
    php运行python脚本失败怎么解决
    Microsoft Defender Vulnerability部署方案
    STL序列式容器二 ----- vector详解
    全国医疗发票OCR识别,一个接口即满足
    C++基础知识(十四)--- vector容器
    你知道Spring是怎么将AOP应用到Bean的生命周期中的吗?
    ES6中Proxy和Proxy实例
  • 原文地址:https://blog.csdn.net/u013916029/article/details/126515133