胡文成的个人博客

安装Harbor的系统要求

2024-07-29

一、硬件要求

资源 最小要求 推荐要求
核心数(CPU) 2 CPU 4 CPU
内存(Memory) 4 GB 8 GB
磁盘(Disk) 40 GB 160 GB

二、软件要求

以下软件必须在机器上安装

软件名称 软件版本 说明
Docker Engine Docker CE 20.10.10版本以及更高 安装请参考[Docker Engine文档]
Docker Componse docker-compose v1.18.0版本之上或docker-compose-plugin 安装请参考[Docker Compose文档]
OpenSSL 优先使用最新版本 用来为Harbor生成证书和密钥
1、安装dockerdocker-compose-plugin
Step1:添加docker-ce源
1
2
3
[root@harbor ~]# curl https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
[root@harbor ~]# sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
[root@harbor ~]# dnf makecache
Step2:删除老版本组件
1
2
3
4
5
6
7
8
[root@harbor ~]# dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
Step3:安装docker-ce,并添加到开机启动
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
[root@harbor ~]# dnf -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
CentOS Stream 9 - Extras packages 45 kB/s | 3.0 kB 00:00
Docker CE Stable - x86_64 30 kB/s | 3.5 kB 00:00
依赖关系解决。
================================================================================================================================================================================================================
软件包 架构 版本 仓库 大小
================================================================================================================================================================================================================
安装:
containerd.io x86_64 1.7.19-3.1.el9 docker-ce-stable 43 M
docker-buildx-plugin x86_64 0.16.1-1.el9 docker-ce-stable 14 M
docker-ce x86_64 3:27.1.1-1.el9 docker-ce-stable 27 M
docker-ce-cli x86_64 1:27.1.1-1.el9 docker-ce-stable 7.8 M
docker-compose-plugin x86_64 2.29.1-1.el9 docker-ce-stable 13 M
安装弱的依赖:
docker-ce-rootless-extras x86_64 27.1.1-1.el9 docker-ce-stable 4.0 M

事务概要
================================================================================================================================================================================================================
安装 6 软件包

总下载:109 M
安装大小:422 M
下载软件包:
(1/6): docker-buildx-plugin-0.16.1-1.el9.x86_64.rpm 24 MB/s | 14 MB 00:00
(2/6): docker-ce-cli-27.1.1-1.el9.x86_64.rpm 6.9 MB/s | 7.8 MB 00:01
(3/6): docker-ce-27.1.1-1.el9.x86_64.rpm 13 MB/s | 27 MB 00:02
(4/6): docker-ce-rootless-extras-27.1.1-1.el9.x86_64.rpm 6.9 MB/s | 4.0 MB 00:00
(5/6): docker-compose-plugin-2.29.1-1.el9.x86_64.rpm 12 MB/s | 13 MB 00:01
(6/6): containerd.io-1.7.19-3.1.el9.x86_64.rpm 12 MB/s | 43 MB 00:03
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计 31 MB/s | 109 MB 00:03
Docker CE Stable - x86_64 24 kB/s | 1.6 kB 00:00
导入 GPG 公钥 0x621E9F35:
Userid: "Docker Release (CE rpm) <docker@docker.com>"
指纹: 060A 61C5 1B55 8A7F 742B 77AA C52F EB6B 621E 9F35
来自: https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
导入公钥成功
运行事务检查
事务检查成功。
运行事务测试
事务测试成功。
运行事务
准备中 : 1/1
安装 : docker-compose-plugin-2.29.1-1.el9.x86_64 1/6
运行脚本: docker-compose-plugin-2.29.1-1.el9.x86_64 1/6
安装 : docker-buildx-plugin-0.16.1-1.el9.x86_64 2/6
运行脚本: docker-buildx-plugin-0.16.1-1.el9.x86_64 2/6
安装 : docker-ce-cli-1:27.1.1-1.el9.x86_64 3/6
运行脚本: docker-ce-cli-1:27.1.1-1.el9.x86_64 3/6
安装 : containerd.io-1.7.19-3.1.el9.x86_64 4/6
运行脚本: containerd.io-1.7.19-3.1.el9.x86_64 4/6
安装 : docker-ce-rootless-extras-27.1.1-1.el9.x86_64 5/6
运行脚本: docker-ce-rootless-extras-27.1.1-1.el9.x86_64 5/6
安装 : docker-ce-3:27.1.1-1.el9.x86_64 6/6
运行脚本: docker-ce-3:27.1.1-1.el9.x86_64 6/6
验证 : containerd.io-1.7.19-3.1.el9.x86_64 1/6
验证 : docker-buildx-plugin-0.16.1-1.el9.x86_64 2/6
验证 : docker-ce-3:27.1.1-1.el9.x86_64 3/6
验证 : docker-ce-cli-1:27.1.1-1.el9.x86_64 4/6
验证 : docker-ce-rootless-extras-27.1.1-1.el9.x86_64 5/6
验证 : docker-compose-plugin-2.29.1-1.el9.x86_64 6/6

已安装:
containerd.io-1.7.19-3.1.el9.x86_64 docker-buildx-plugin-0.16.1-1.el9.x86_64 docker-ce-3:27.1.1-1.el9.x86_64 docker-ce-cli-1:27.1.1-1.el9.x86_64 docker-ce-rootless-extras-27.1.1-1.el9.x86_64
docker-compose-plugin-2.29.1-1.el9.x86_64

完毕!
[root@harbor ~]# systemctl enable --now docker
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.
Step4:配置Docker镜像加速
1
[root@harbor ~]# vim /etc/docker/daemon.json

daemon.json文件内容

1
2
3
{
"registry-mirrors": ["https://xxxx.mirror.aliyuncs.com"]
}
2、安装openssl
1
[root@harbor ~]# dnf install -y openssl

三、开放网络端口

端口号 协议 说明
443 HTTPS Harbor访问入口以及核心API接受HTTPS请求的端口,可以在配置文件中修改此端口
4443 HTTPS 给Harbor连接Docker内容信任服务的端口,可以在配置文件中修改此端口
80 HTTP Harbor访问入口以及核心API接受HTTPS请求的端口,可以在配置文件中修改此端口
1
2
3
4
5
[root@harbor ~]# firewall-cmd --zone=public --add-service=https --permanent
[root@harbor ~]# firewall-cmd --zone=public --add-service=http --permanent
[root@harbor ~]# firewall-cmd --zone=public --add-port=4443/tcp --permanent
[root@harbor ~]# firewall-cmd --reload
[root@harbor ~]# firewall-cmd --list-all
Tags: harbor

扫描二维码,分享此文章