• Linux 安装Harbor镜像仓库私服


    参考链接

    Docker 的基础知识、安装、使用+Harbor镜像仓库私服搭建

    Harbor是什么?

    Harbor是由VMware公司开源的企业级的Docker Registry管理项目,它包括权限管理(RBAC)、LDAP、日志审核、管理界面、自我注册、镜像复制和中文支持等功能。
    Harbor 的所有组件都在 Docker 中部署,所以 Harbor 可使用 Docker Compose 快速部署。
    Harbor的目标是帮助用户迅速搭建一个企业级的Docker registry服务。它以Docker公司开源的registry为基础,额外提供了如下功能:

    • 基于角色的访问控制(Role Based Access Control)
    • 基于策略的镜像复制(Policy based image replication)
    • 镜像的漏洞扫描(Vulnerability Scanning)
    • AD/LDAP集成(LDAP/AD support)
    • 镜像的删除和空间清理(Image deletion & garbage collection)
    • 友好的管理UI(Graphical user portal)
    • 审计日志(Audit logging)
    • RESTful API
    • 部署简单(Easy deployment)

    安装和启动Harbor

    1. 安装Docker

    依次执行如下命令:

    curl -fsSL https://get.docker.com -o get-docker.sh
    chmod +x get-docker.sh && ./get-docker.sh
    # 查看docker的版本
    # docker --version
    Docker version 20.10.5+dfsg1, build 55c4c88
    
    • 1
    • 2
    • 3
    • 4
    • 5

    2. 安装harbor

    mkdir -p harbor
    cd harbor
    wget https://storage.googleapis.com/harbor-releases/release-2.0.0/harbor-offline-installer-latest.tgz
    tar -xvf harbor-offline-installer-latest.tgz
    vim harbor.yml.tmpl
    cp harbor.yml.tmpl harbor.yml
    ./install.sh
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    执行vim harbor.yml.tmpl这一步时,修改Harbor配置文件:

    1. hostname:Harbor服务器IP,需要修改为服务器的IP或者“0.0.0.0”,不能使用“localhost” 或者“127.0.0.1”,因为需要从外部访问Harbor;
    2. http: HTTP端口号,port的值默认为80,有需要可以修改;
    3. https:HTTPS端口号,如果需要使用HTTPS方法访问Harbor,那么需要配置服务器证书和私钥,同时修改certificateprivate_key为服务器证书文件和私钥文件的绝对路径。port的值默认为443,有需要可以修改port为其他值;
    4. harbor_admin_password:Harbor admin用户的密码,初始值为Harbor12345,可以根据需要修改。

    下面是Harbor配置文件的示例片段:

    # Configuration file of Harbor
    
    # The IP address or hostname to access admin UI and registry service.
    # DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
    hostname: 0.0.0.0
    
    # http related config
    http:
      # port for http, default is 80. If https enabled, this port will redirect to https port
      port: 80
    
    # 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
    
    # # Uncomment following will enable tls communication between all harbor components
    # internal_tls:
    #   # set enabled to true means internal tls is enabled
    #   enabled: true
    #   # put your cert and key files on dir
    #   dir: /etc/harbor/tls/internal
    
    # Uncomment external_url if you want to enable external proxy
    # And when it enabled the hostname will no longer used
    # external_url: https://reg.mydomain.com:8433
    
    # The initial password of Harbor admin
    # It only works in first time to install harbor
    # Remember Change the admin password from UI after launching Harbor.
    harbor_admin_password: Harbor12345
    
    • 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

    3. 安装docker-compose

    apt install docker-compose
    
    • 1

    4. 启动Harbor

    docker-compose up -d
    
    • 1

    在浏览器地址栏输入Harbor配置文件中配置的地址:如 http://192.168.11.18:5000/, 进入Harbor登录页面:
    在这里插入图片描述

    输入Harbor配置文件中配置的用户名和密码:
    在这里插入图片描述

  • 相关阅读:
    SVN_SERVER的搭建
    [题] 子矩阵的和 #二维前缀和
    前端如何把HTML转成图片再下载
    前端入职配置新电脑!!!
    DW大学生网页作业制作设计 基于html+css我的家乡贵州网页项目的设计与实现
    怎样判断气门油封有问题?
    纷享销客2022新增长系列之《高科技行业橙皮书》重磅发布
    【NoSQL】NoSQL之redis配置与优化(简单操作)
    Vatee万腾未来科技之航:Vatee创新引领的新纪元
    图解Mysql索引原理
  • 原文地址:https://blog.csdn.net/bitcsljl/article/details/132852705