• Docker:Harbor


    目录

    一、Harbor介绍

    二、安装 Harbor

    2.1 环境准备

    2.2下载 Harbor

    3.3 修改配置(可选)

    3.4 启动 Harbor

    3.5访问 Harbor

    三、使用 Harbor

    3.1 管理Harbor


    一、Harbor介绍

            Docker Harbor 是由 VMware 公司开源的一款企业级的 Docker Registry 项目,旨在为用户提供一个便捷的方式来搭建和管理私有 Docker 镜像仓库。

    二、安装 Harbor

    2.1 环境准备

            Harbor 是作为一个包含多个服务的 Docker 应用程序部署的,因此,目标主机需要安装 Docker 和 Docker Compose。

    2.2下载 Harbor

            访问 Harbor 的官方网站或其 GitHub 仓库,下载最新版本的 Harbor 部署包。通常,下载的文件是一个压缩包,解压后会包含一个 `docker-compose.yml` 文件和其他配置文件。

    1. # 下载
    2. https://github.com/goharbor/harbor/releases/download/v2.11.0/harbor-offline-installer-v2.11.0.tgz
    3. #解压
    4. tar -zxvf harbor-offline-installer-v2.11.0.tgz

    3.3 修改配置(可选)

            根据你的环境需求,你可能需要修改 `harbor.yml` 配置文件中的参数,比如 HTTP/HTTPS 端口、存储方式、数据库设置等。

    1. # Configuration file of Harbor
    2. # The IP address or hostname to access admin UI and registry service.
    3. # DO NOT use localhost or 127.0.0.1, because Harbor needs to be accessed by external clients.
    4. hostname: 192.168.179.134
    5. # http related config
    6. http:
    7. # port for http, default is 80. If https enabled, this port will redirect to https port
    8. port: 8888
    9. # https related config
    10. #https:
    11. # # https port for harbor, default is 443
    12. # port: 443
    13. # # The path of cert and key files for nginx
    14. # certificate: /your/certificate/path
    15. # private_key: /your/private/key/path
    16. # enable strong ssl ciphers (default: false)
    17. # strong_ssl_ciphers: false
    18. harbor_admin_password: Harbor12345
    19. # Harbor DB configuration
    20. database:
    21. # The password for the root user of Harbor DB. Change this before any production use.
    22. password: root123
    23. # The maximum number of connections in the idle connection pool. If it <=0, no idle connections are retained.
    24. max_idle_conns: 100
    25. # The maximum number of open connections to the database. If it <= 0, then there is no limit on the number of open connections.
    26. # Note: the default number of connections is 1024 for postgres of harbor.
    27. max_open_conns: 900
    28. # The maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse. If it <= 0, connections are not closed due to a connection's age.
    29. # The value is a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
    30. conn_max_lifetime: 5m
    31. # The maximum amount of time a connection may be idle. Expired connections may be closed lazily before reuse. If it <= 0, connections are not closed due to a connection's idle time.
    32. # The value is a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
    33. conn_max_idle_time: 0
    34. # The default data volume
    35. data_volume: /data/opt/harbor/data

    3.4 启动 Harbor

            在 Harbor 解压目录下,执行以下命令启动 Harbor:

    ./install.sh

    3.5访问 Harbor

           启动成功后,你可以通过 Web 浏览器访问 Harbor 的管理界面,通常是 `http://:80` 或者根据你的配置可能使用 HTTPS 和指定的端口。默认的管理员用户名和密码通常是 `admin/Harbor12345`,首次登录后应立即更改默认密码。

    三、使用 Harbor

    3.1 管理Harbor

    1. # 停止 Harbor
    2. docker-compose stop
    3. # 重启 Harbor
    4. docker-compose start
    5. # 重新配置 Harbor
    6. #1.停止 Harbor
    7. docker-compose down -v
    8. #2.更新 harbor.yml
    9. vim harbor.yml
    10. #3.运行脚本以填充配置
    11. ./prepare
    12. 4.重新创建并启动 Harbor 实例
    13. docker-compose up -d


     

  • 相关阅读:
    C++goto语句
    Wagtail SearchBackend —— ElasticSearch7 https 连接问题
    R之线性回归模型
    Spring Boot集成antlr实现词法和语法分析
    性能优化-如何爽玩多线程来开发
    Java本地高性能缓存的几种实现方式
    Kotlin小节(二)
    python第三方库-字符串编码工具 chardet 的使用(python3经典编程案例)
    小程序开发必备功能的吐血整理【个人中心界面样式大全】
    项目管理软件dhtmlxGantt配置教程(九):输入值验证方法
  • 原文地址:https://blog.csdn.net/m0_37559973/article/details/139739748