Harbor 的安装及使用

news/2024/7/8 3:23:12

Harbor 安装官网手册:
https://goharbor.io/docs/2.10.0/install-config/download-installer/

Harbor 发布包地址:
https://github.com/goharbor/harbor/releases

  • 在部署harbor的前提下先安装docker 和 docker-compose

    安装docker:https://docs.docker.com/engine/install/centos/
    安装docker-compos: https://docs.docker.com/compose/install/standalone/

  • 下载 Offline installer 安装包(如果网络慢可以选择科学上网下载到服务器上)
    wget -P /opt -https://github.com/goharbor/harbor/releases/download/v2.9.3-rc1/harbor-offline-installer-v2.9.3-rc1.tgz

  • 解压

      # tar -zxvf harbor-offline-installer-v2.9.3-rc1.tgz
    
    # tree  harbor
    harbor
    ├── common.sh
    ├── harbor.v2.9.3.tar.gz
    ├── harbor.yml.tmpl
    ├── install.sh
    ├── LICENSE
    └── prepare
    
    0 directories, 6 files
    
  • 配置文件各项含义

    配置文件模版为harbor.yml.tmpl 使用时,将 cp harbor.yml.tmpl harbor.yml

    官网配置文件文档:https://goharbor.io/docs/2.10.0/install-config/configure-yml-file/

  • 修改配置文件

    # cp harbor.yml.tmpl harbor.yml
    # cat harbor.yml
    
    hostname: 192.168.44.161		# 由于harbor是docker部署,所有这里需要写宿主机的IP(可以访问的域名)
    # 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
    ......
    其他的可以默认
    
  • 安装Harbor
    默认的 Harbor 安装不包括 Trivy 服务。运行以下命令

      ./install.sh
    

    要使用 Trivy 服务安装 Harbor,请–with-trivy在运行时添加参数install.sh:

      ./install.sh --with-trivy
    
  • 使用查看所有服务

      # docker-compose ls
    
    # docker-compose ls
    NAME                STATUS              CONFIG FILES
    harbor              running(10)         /opt/harbor/docker-compose.yml
    
    # docker-compose ps		# 需要在yaml文件同级目录下执行
    NAME                IMAGE                                  COMMAND                   SERVICE         CREATED          STATUS                    PORTS
    harbor-core         goharbor/harbor-core:v2.9.3            "/harbor/entrypoint.…"   core            13 minutes ago   Up 13 minutes (healthy)   
    harbor-db           goharbor/harbor-db:v2.9.3              "/docker-entrypoint.…"   postgresql      13 minutes ago   Up 13 minutes (healthy)   
    harbor-jobservice   goharbor/harbor-jobservice:v2.9.3      "/harbor/entrypoint.…"   jobservice      13 minutes ago   Up 13 minutes (healthy)   
    harbor-log          goharbor/harbor-log:v2.9.3             "/bin/sh -c /usr/loc…"   log             13 minutes ago   Up 13 minutes (healthy)   127.0.0.1:1514->10514/tcp
    harbor-portal       goharbor/harbor-portal:v2.9.3          "nginx -g 'daemon of…"   portal          13 minutes ago   Up 13 minutes (healthy)   
    nginx               goharbor/nginx-photon:v2.9.3           "nginx -g 'daemon of…"   proxy           13 minutes ago   Up 13 minutes (healthy)   0.0.0.0:80->8080/tcp, :::80->8080/tcp
    redis               goharbor/redis-photon:v2.9.3           "redis-server /etc/r…"   redis           13 minutes ago   Up 13 minutes (healthy)   
    registry            goharbor/registry-photon:v2.9.3        "/home/harbor/entryp…"   registry        13 minutes ago   Up 13 minutes (healthy)   
    registryctl         goharbor/harbor-registryctl:v2.9.3     "/home/harbor/start.…"   registryctl     13 minutes ago   Up 13 minutes (healthy)   
    trivy-adapter       goharbor/trivy-adapter-photon:v2.9.3   "/home/scanner/entry…"   trivy-adapter   13 minutes ago   Up 13 minutes (healthy)
    
  • 管理 harbor
    停止

      # docker-compose down -v
    

    启动

      # docker-compose up -d
    
  • 访问harbor
    默认账号密码是: admin/Harbor12345
    在这里插入图片描述


http://lihuaxi.xjx100.cn/news/2058217.html

相关文章

基于ssm课程管理系统

基于SSM的课程管理系统的设计与实现 摘 要 当下,正处于信息化的时代,许多行业顺应时代的变化,结合使用计算机技术向数字化、信息化建设迈进。以前学校对于课程信息的管理和控制,采用人工登记的方式保存相关数据,这种以…

表单验证、属性绑定(一个属性根据另一个属性有无进行操作)

表单验证 一个属性根据另一个属性有无进行操作(属性绑定) 1、问题描述 ​ 需求:表单里面后两个属性需要根据前面一个属性进行有无判断。如果前面属性没有输入值,则不需要进行操作;如果前面属性有输入值,则…

C#中处理文件的类以及应用程序配置文件简介

文章目录 一、C#中处理文件的类介绍二、应用程序配置文件应用程序配置文件的用途:如何使用配置文件: 一、C#中处理文件的类介绍 在C#中,处理文件的通用类是System.IO.File,它提供了一系列静态方法,可用于创建、复制、…

用stream流将list转为map

用stream流将list转为map 1、将list转为Map<Long, List> 按照spaceId分组&#xff0c;spaceId相同的为一组数据&#xff1a; List<BasEvaluationPriceResultDto> list new ArrayList(); Map<Long, List<BasEvaluationPriceResultDto>> priceResult…

一个类的名字后缀有Handler的都是有什么作用?

在Java中&#xff0c;类名后缀为"Handler"通常表示该类是一个处理器&#xff08;Handler&#xff09;。处理器是用来处理特定任务或事件的组件&#xff0c;通常在事件驱动的编程中使用。这种命名惯例在许多框架和库中都很常见&#xff0c;其中一些常见的用法包括&…

递归法解决多重背包问题

多重背包问题同样是01背包问题的变种&#xff0c;同样可以通过修改01背包部分代码来求解。 方法一&#xff1a;修改递归函数&#xff0c;根据题目新的限制条件——使用次数扩充状态参数个数&#xff0c;将同一个物品选用的次数同样作为参数传递到栈空间中&#xff0c;同时也对…

linux-c时间定时器函数timerfd

timerfd是Linux为用户程序提供的一个定时器接口。这个接口基于文件描述符&#xff0c;通过文件描述符的可读事件进行超时通知&#xff0c;所以能够被用于select/poll的应用场景。 ​ int timerfd_create(intclockid, intflags);int timerfd_settime(intfd, intflags, const st…

Win10共享打印机提示没有权限使用网络资源怎么办?

win10已共享打印机但别电脑找不到该怎么办&#xff1f;我们来看看解决方法&#xff0c;打开控制面板后点击程序与功能&#xff0c;点击启用或关闭Windows功能&#xff0c;勾选SMB文件共享支持功能即可&#xff0c;具体的操作步骤如下&#xff1a; 进入程序与功能 进入WIN10系统…