Installing harbor-2.6.2 on openEuler

一、Installation harbor-2.6.2 on openEuler

1 地址

Installing harbor-2.6.2 on openEuler

Installing harbor-2.6.2 on openEuler

2 Harbor 安装条件

部署Harbor的最低硬件和软件配置:https://goharbor.io/docs/2.0.0/install-config/installation-prereqs

2.1 Hardware

The following table lists the minimum and recommended hardware configurations for deploying Harbor.

Resource Minimum Recommended CPU 2 CPU 4 CPU Mem 4 GB 8 GB Disk 40 GB 160 GB

2.2 Software

The following table lists the software versions that must be installed on the target host.

Software Version Description Docker engine Version 17.06.0-ce+ or higher For installation instructions, see Docker Engine documentationDocker Compose Version 1.18.0 or higher For installation instructions, see Docker Compose documentationOpenssl Latest is preferred Used to generate certificate and keys for Harbor

2.3 Network ports

Harbor requires that the following ports be open on the target host.

Port Protocol Description 443 HTTPS Harbor portal and core API accept HTTPS requests on this port. You can change this port in the configuration file.4443 HTTPS Connections to the Docker Content Trust service for Harbor. Only required if Notary is enabled. You can change this port in the configuration file.80 HTTP Harbor portal and core API accept HTTP requests on this port. You can change this port in the configuration file.

3 docker 和 docker-compose 安装在底部!

二、离线安装 Harbor

1 wget 下载

mkdir /opt/software && cd /opt/software
wget https://github.com/goharbor/harbor/releases/download/v2.6.2/harbor-offline-installer-v2.6.2.tgz

2 解压

tar -zxvf /opt/software/harbor-offline-installer-v2.6.2.tgz -C /opt && cd /opt/harbor && ll
total 774M
-rw-r--r-- 1 root root 3.6K Nov  9 17:35 common.sh
-rw-r--r-- 1 root root 774M Nov  9 17:36 harbor.v2.6.2.tar.gz
-rw-r--r-- 1 root root  11K Nov  9 17:35 harbor.yml.tmpl
-rwxr-xr-x 1 root root 3.1K Nov  9 17:35 install.sh
-rw-r--r-- 1 root root  12K Nov  9 17:35 LICENSE
-rwxr-xr-x 1 root root 1.9K Nov  9 17:35 prepare

最主要的是 harbor.yml.tmplinstall.sh ,分别是配置文件和安装执行文件。

3 修改配置文件

### 备份一下
cp /opt/harbor/harbor.yml.tmpl /opt/harbor/harbor.yml

### 修改配置文件
vim /opt/harbor/harbor.yml
5 hostname: 114.116...

10 port: 8084
34 harbor_admin_password: root
39 password: root123
47 data_volume: /opt/harbor/data
131 location: /var/log/harbor

### 创建数据和日志目录
mkdir /opt/harbor/data
mkdir /var/log/harbor

4 修改daemon

添加http的通信地址,docker默认使用https进行通信,如果配置了https协议就不需要添加。

cat > /etc/docker/daemon.json << EOF
{
    "registry-mirrors": [
      "https://registry.docker-cn.com",
      "https://docker.mirrors.ustc.edu.cn",
      "https://dockerhub.azk8s.cn",
      "http://hub-mirror.c.163.com"
    ],
    "experimental": true,
    "exec-opts": ["native.cgroupdriver=systemd"],
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "100m"
    },
    "insecure-registries": ["114.116...:8084"]
}
EOF

5 重新加载配置和重启docker

systemctl daemon-reload && systemctl restart docker

6 执行部署脚本

/opt/harbor/install.sh

### &#x67E5;&#x770B;&#x8FDB;&#x7A0B;
ps -ef |grep harbor

### &#x67E5;&#x770B;&#x955C;&#x50CF;
docker images

### &#x67E5;&#x770B;&#x955C;&#x50CF;&#x542F;&#x52A8;
docker ps -a

7 登陆 Harbor

服务器 IP:8084

默认用户名: admin密码: root

Installing harbor-2.6.2 on openEuler

8 命令行登陆 docker

docker info
docker login 114.116...:8084

Installing harbor-2.6.2 on openEuler

三、测试上传和下载

1harbor创建项目

项目—>新建项目—>项目名称—>镜像仓库

Installing harbor-2.6.2 on openEuler

2 对需要推送的镜像签名

docker pull tomcat
docker images

### tomcat&#x955C;&#x50CF;&#x8BBE;&#x7F6E;&#x6807;&#x7B7E;
docker tag tomcat:latest 114.116...:8084/iyuyixyz/tomcat:latest
docker push 114.116...:8084/iyuyixyz/tomcat:latest

Installing harbor-2.6.2 on openEuler

推送成功!

四、harbor的停止与启动

cd /opt/harbor
### &#x505C;&#x6B62;
docker-compose stop
### &#x542F;&#x52A8;(&#x7B2C;&#x4E00;&#x6B21;&#x9700;&#x8981;&#x4F7F;&#x7528; up -d)
docker-compose start

### &#x5982;&#x679C; Harbor &#x5DF2;&#x5728;&#x8FD0;&#x884C;&#xFF0C;&#x8BF7;&#x505C;&#x6B62;&#x5E76;&#x5220;&#x9664;&#x73B0;&#x6709;&#x5B9E;&#x4F8B;&#x3002;
### &#x6570;&#x636E;&#x4FDD;&#x7559;&#x5728;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E2D;&#xFF08;&#x614E;&#x7528;&#xFF09;
docker-compose down
### &#x521B;&#x5EFA;&#x5E76;&#x542F;&#x52A8;
docker-compose up -d

X、One Step Success

1 /opt/harbor/install.sh harbor 安装日志

查看代码

[root@ecs-65685 ~]# /opt/harbor/install.sh

[Step 0]: checking if docker is installed ...

Note: docker version: 18.09.0

[Step 1]: checking docker-compose is installed ...

Note: docker-compose version: 2.10.2

[Step 2]: loading Harbor images ...

93d5db33d7f0: Loading layer [==================================================>]  37.72MB/37.72MB
fed5229d083f: Loading layer [==================================================>]  8.902MB/8.902MB
60993d7b1dd7: Loading layer [==================================================>]  3.584kB/3.584kB
dcfafa86c82f: Loading layer [==================================================>]   2.56kB/2.56kB
8eecc685f414: Loading layer [==================================================>]  102.3MB/102.3MB
d93c6405d04a: Loading layer [==================================================>]  103.1MB/103.1MB
Loaded image: goharbor/harbor-jobservice:v2.6.2
a279a640c793: Loading layer [==================================================>]  6.287MB/6.287MB
4f9d6222bbfe: Loading layer [==================================================>]  4.096kB/4.096kB
55ce939e7c9a: Loading layer [==================================================>]  3.072kB/3.072kB
a631cda93151: Loading layer [==================================================>]    186MB/186MB
6fe15b823e2b: Loading layer [==================================================>]  12.87MB/12.87MB
48c9bf72ec70: Loading layer [==================================================>]  199.6MB/199.6MB
Loaded image: goharbor/trivy-adapter-photon:v2.6.2
a9c145b6d823: Loading layer [==================================================>]  5.759MB/5.759MB
7493dee46b78: Loading layer [==================================================>]  90.88MB/90.88MB
531fd3669887: Loading layer [==================================================>]  3.072kB/3.072kB
8bf93a9c7cac: Loading layer [==================================================>]  4.096kB/4.096kB
697af810c7b0: Loading layer [==================================================>]  91.67MB/91.67MB
Loaded image: goharbor/chartmuseum-photon:v2.6.2
565c6d1e1338: Loading layer [==================================================>]  119.9MB/119.9MB
070770563b0d: Loading layer [==================================================>]  3.072kB/3.072kB
1cbd1219edb1: Loading layer [==================================================>]   59.9kB/59.9kB
1eafa56427f8: Loading layer [==================================================>]  61.95kB/61.95kB
Loaded image: goharbor/redis-photon:v2.6.2
b1e37b42b3c0: Loading layer [==================================================>]  119.1MB/119.1MB
Loaded image: goharbor/nginx-photon:v2.6.2
0242e94056b7: Loading layer [==================================================>]  5.754MB/5.754MB
f25460e36589: Loading layer [==================================================>]  8.735MB/8.735MB
0854e8369d2a: Loading layer [==================================================>]  14.47MB/14.47MB
1d58fd938f61: Loading layer [==================================================>]  29.29MB/29.29MB
bbf9db741c3d: Loading layer [==================================================>]  22.02kB/22.02kB
41ea5b5c915c: Loading layer [==================================================>]  14.47MB/14.47MB
Loaded image: goharbor/notary-signer-photon:v2.6.2
1a91031428df: Loading layer [==================================================>]  8.902MB/8.902MB
3b0b5cc72c70: Loading layer [==================================================>]  3.584kB/3.584kB
773ad3349c8a: Loading layer [==================================================>]   2.56kB/2.56kB
39140cab076f: Loading layer [==================================================>]  83.92MB/83.92MB
6c80f545b0fa: Loading layer [==================================================>]  5.632kB/5.632kB
0ccee37aa42e: Loading layer [==================================================>]  106.5kB/106.5kB
756d72e6b8c7: Loading layer [==================================================>]  44.03kB/44.03kB
01a12d2708e6: Loading layer [==================================================>]  84.87MB/84.87MB
eab188b4f0ed: Loading layer [==================================================>]   2.56kB/2.56kB
Loaded image: goharbor/harbor-core:v2.6.2
3aecbbff620d: Loading layer [==================================================>]  1.097MB/1.097MB
3ee789a1e97c: Loading layer [==================================================>]  5.888MB/5.888MB
285f58d22327: Loading layer [==================================================>]    169MB/169MB
b47f4e789504: Loading layer [==================================================>]  16.98MB/16.98MB
e8b4a74e7102: Loading layer [==================================================>]  4.096kB/4.096kB
52bc97105e75: Loading layer [==================================================>]  6.144kB/6.144kB
21cad868f5ac: Loading layer [==================================================>]  3.072kB/3.072kB
6b24213c30fd: Loading layer [==================================================>]  2.048kB/2.048kB
54dd774f4fcd: Loading layer [==================================================>]   2.56kB/2.56kB
8fcc4e1141e7: Loading layer [==================================================>]   2.56kB/2.56kB
47e81a37ed9a: Loading layer [==================================================>]   2.56kB/2.56kB
15a2f5707a75: Loading layer [==================================================>]  8.704kB/8.704kB
Loaded image: goharbor/harbor-db:v2.6.2
b87a3132dc28: Loading layer [==================================================>]  5.759MB/5.759MB
099c3879eab4: Loading layer [==================================================>]  4.096kB/4.096kB
e111d5399557: Loading layer [==================================================>]  17.11MB/17.11MB
0339872ecc4b: Loading layer [==================================================>]  3.072kB/3.072kB
28d42c5fb14d: Loading layer [==================================================>]  29.71MB/29.71MB
a6e47445b2a9: Loading layer [==================================================>]  47.61MB/47.61MB
Loaded image: goharbor/harbor-registryctl:v2.6.2
dc8141f6851b: Loading layer [==================================================>]  8.902MB/8.902MB
98b4e2589226: Loading layer [==================================================>]  25.08MB/25.08MB
b413ead94415: Loading layer [==================================================>]  4.608kB/4.608kB
2c8d3d788084: Loading layer [==================================================>]  25.88MB/25.88MB
Loaded image: goharbor/harbor-exporter:v2.6.2
393d5a0ffc78: Loading layer [==================================================>]  43.85MB/43.85MB
a93c9af803e4: Loading layer [==================================================>]  65.97MB/65.97MB
7d77c2b336d0: Loading layer [==================================================>]  18.28MB/18.28MB
a023a4db994f: Loading layer [==================================================>]  65.54kB/65.54kB
938defed7f01: Loading layer [==================================================>]   2.56kB/2.56kB
40a257e6076f: Loading layer [==================================================>]  1.536kB/1.536kB
0a9ee117d49e: Loading layer [==================================================>]  12.29kB/12.29kB
fee3e00ceac7: Loading layer [==================================================>]  2.613MB/2.613MB
aa7a1d37a974: Loading layer [==================================================>]  379.9kB/379.9kB
Loaded image: goharbor/prepare:v2.6.2
43e329977d55: Loading layer [==================================================>]  5.759MB/5.759MB
cd7f664a365e: Loading layer [==================================================>]  4.096kB/4.096kB
d52491a2b6aa: Loading layer [==================================================>]  3.072kB/3.072kB
96c88da130e9: Loading layer [==================================================>]  17.11MB/17.11MB
3ed947e61e01: Loading layer [==================================================>]   17.9MB/17.9MB
Loaded image: goharbor/registry-photon:v2.6.2
c326200729cd: Loading layer [==================================================>]  5.754MB/5.754MB
dddf8a3ea2da: Loading layer [==================================================>]  8.735MB/8.735MB
64881611b8c7: Loading layer [==================================================>]  15.88MB/15.88MB
e8316cf8a6f4: Loading layer [==================================================>]  29.29MB/29.29MB
a36ddfae8822: Loading layer [==================================================>]  22.02kB/22.02kB
071790bc488e: Loading layer [==================================================>]  15.88MB/15.88MB
Loaded image: goharbor/notary-server-photon:v2.6.2
02fbd82c1ad9: Loading layer [==================================================>]  119.1MB/119.1MB
4cb31a91fcbf: Loading layer [==================================================>]  7.538MB/7.538MB
5c4e30d33b60: Loading layer [==================================================>]  1.185MB/1.185MB
Loaded image: goharbor/harbor-portal:v2.6.2
f0b226869da1: Loading layer [==================================================>]  126.9MB/126.9MB
375103145f01: Loading layer [==================================================>]  3.584kB/3.584kB
5cf0e3f47476: Loading layer [==================================================>]  3.072kB/3.072kB
67b68a640c0f: Loading layer [==================================================>]   2.56kB/2.56kB
d1537b9cab8f: Loading layer [==================================================>]  3.072kB/3.072kB
fccaf06d29a5: Loading layer [==================================================>]  3.584kB/3.584kB
02d47852b759: Loading layer [==================================================>]  20.99kB/20.99kB
Loaded image: goharbor/harbor-log:v2.6.2

[Step 3]: preparing environment ...

[Step 4]: preparing harbor configs ...

prepare base dir is set to /opt/harbor
WARNING:root:WARNING: HTTP protocol is insecure. Harbor will deprecate http protocol in the future. Please make sure to upgrade to https
Generated configuration file: /config/portal/nginx.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
Generated and saved secret to file: /data/secret/keys/secretkey
Successfully called func: create_root_cert
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir

Note: stopping existing Harbor instance ...

[Step 5]: starting Harbor ...

[+] Running 10/10
 &#x283F; Network harbor_harbor        Created                                                                                           0.0s
 &#x283F; Container harbor-log         Started                                                                                           0.5s
 &#x283F; Container redis              Started                                                                                           0.8s
 &#x283F; Container harbor-portal      Started                                                                                           1.0s
 &#x283F; Container registry           Started                                                                                           1.0s
 &#x283F; Container harbor-db          Started                                                                                           1.1s
 &#x283F; Container registryctl        Started                                                                                           1.1s
 &#x283F; Container harbor-core        Started                                                                                           1.2s
 &#x283F; Container nginx              Started                                                                                           1.6s
 &#x283F; Container harbor-jobservice  Started                                                                                           1.7s
&#x2714; ----Harbor has been installed and started successfully.----

Y、Error message

1 绑定源路径不存在

Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /var/log/harbor/

解决

mkdir /var/log/harbor/

2 权限被拒绝

nginx: [emerg] open() "/etc/nginx/nginx.conf" failed (13: Permission denied)

解决

### -^-

Z、Related Links

Installation docker-20.10.12 on CentOS 7.9:https://www.cnblogs.com/huaxiayuyi/p/16775236.html
Installation docker on openEuler:https://www.cnblogs.com/huaxiayuyi/p/16894371.html
Installation docker-compose on CentOS 7.9:https://www.cnblogs.com/huaxiayuyi/p/16775728.html
Installation harbor-2.6.2 on CentOS 8.3:https://www.cnblogs.com/huaxiayuyi/p/16894018.html

Original: https://www.cnblogs.com/huaxiayuyi/p/16897413.html
Author: 娇小赤雅
Title: Installing harbor-2.6.2 on openEuler

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/798485/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

  • Shell系统学习之Shell变量和引用

    系列文章目录 变量的类型 变量的定义 变量的作用域 系统变量 环境变量 变量的赋值与清空 引用变量的值 引用和替换 变量的类型 Shell是 动态类型语言和 弱类型语言。 动态类型…

    Python 2023年11月8日
    026
  • AttributeError: module ‘matplotlib‘ has no attribute ‘pyplot‘

    回来了 很久没有更新博客了,上了研究生之后,科研任务蛮重的,还要兼顾学习任务,有时候想写写博客记录记录学习内容,总结总结学习心得什么的,都难有时间。 本科的时候博客大部分内容偏向于…

    Python 2023年9月1日
    056
  • 健身房,我用python给她写了个小米计时器助人为乐

    大家好,我是Lex 喜欢欺负超人那个Lex擅长领域:python开发、网络安全渗透、Windows域控Exchange架构今日重点:Python图形界面开发,实现一个小米手机上的秒…

    Python 2023年9月23日
    046
  • Python空数组判断

    在使用numpy找到指定元素对应索引时,一般会使用numpy.argwhere()或numpy.where()函数。 正常使用numpy.argwhere()函数时,返回结果是元素…

    Python 2023年8月23日
    038
  • Pandas玩转数据透视表,用它就够了~

    大家好,我是丁小杰。 对于数据透视表,相信对于 Excel 比较熟悉的小伙伴都知道如何使用它,并了解它的强大之处,而在 pandas中要实现数据透视就要用到 pivot_table…

    Python 2023年8月16日
    035
  • [Python][pygame][五子棋]基于Python中pygame库的五子棋小游戏

    1、摘要 通过python的pygame库,实现一款支持人机对战和人人对战的五子棋小游戏。在游戏初始界面会有5秒的规则介绍,五秒后自动进入人机对战模式。玩家可根据游戏中的提示按下Q…

    Python 2023年9月22日
    061
  • drf 认证、权限、频率限制以及其源码

    内容概要 token认证小练习 认证 权限 频率 内容详细 登录携带token认证小练习 models.py: class User(models.Model): username…

    Python 2023年5月24日
    077
  • 《数字图像处理》学习笔记

    文章首发于我的 github 仓库-cv算法工程师成长之路,欢迎关注我的公众号-嵌入式视觉。 一,绪论 1.1, 什么是数字图像处理 1.2,数字图像处理的起源 1.3,数字图像处…

    Python 2023年10月27日
    029
  • Python使用python-snap7实现西门子PLC通讯

    Python简介 Python是开源的高级编程语言之一,广泛应用于人工智能、数据分析、爬虫等领域。由于它拥有大量的开源库和标准库,以及简单且贴近自然语言的语法,所以即便是从未接触过…

    Python 2023年8月2日
    059
  • opencv2 图片相似度比较

    from skimage.measure import compare_ssim import cv2 class CompareImage(): def compare_imag…

    Python 2023年8月27日
    032
  • 【WPF】实现动态切换语言(国际化)以及动态换肤功能

    前言:以下内容,手把手从搭建到最终实现,完成多语言切换以及换装功能。 本地系统环境:win 10 编译器环境:VS2022 社区版 .NET 环境: .NET 6 1、新建一个WP…

    Python 2023年10月21日
    038
  • matplotlib之直方图

    文本以及后续的系列文章中均会使用到numpy这个库,numpy是Python的一种开源的数值计算扩展,主要用来生产一些随机数作为绘图的原始数据。具体和安装matplotlib类似,…

    Python 2023年8月30日
    045
  • vivado tcl开发流程

    本文以简单的led灯为例,阐述基于tcl的Vivado开发流程。文件内容编写如下:led.v timescale 1ns / 1ps module led( input wire …

    Python 2023年10月11日
    041
  • Pytest(11)allure报告

    前言 allure是一个report框架,支持java的Junit/testng等框架,当然也可以支持python的pytest框架,也可以集成到Jenkins上展示高大上的报告界…

    Python 2023年9月14日
    062
  • Pandas 缺失值这样一目了然,不香嘛?

    本篇详解pandas中缺失值(Missing data handling)处理常用操作。 缺失值处理常用于数据分析数据清洗阶段;Pandas中将如下类型定义为缺失值:NaN: &#…

    Python 2023年8月18日
    044
  • 并发bug之源(二)-有序性

    什么是有序性? 简单来说,假设你写了下面的程序: int a = 1; int b = 2; System.out.println(a); System.out.println(b…

    Python 2023年10月15日
    041
亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球