arm64服务器下的Harbor-v2.11.1环境搭建

一、搭建过程

1
2
3
4
5
6
7
8
root@ubuntu20:~# mkdir -p /opt/installPkgs/installHarbor
root@ubuntu20:~# cd /opt/installPkgs/installHarbor

#下载编排文件docker-compose.yml
root@ubuntu20:/opt/installPkgs/installHarbor# curl -LO https://raw.githubusercontent.com/bitnami/containers/main/bitnami/harbor-portal/docker-compose.yml

#下载安装文件,解压然后移动文件
root@ubuntu20:/opt/installPkgs/installHarbor# curl -L https://github.com/bitnami/containers/archive/main.tar.gz | tar xz --strip=2 containers-main/bitnami/harbor-portal && cp -RL harbor-portal/2/debian-12/config ./ && rm -rf harbor-portal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#编译docker配置文件,添加如下镜像代理网站(不一定非常好用,但比没有时效果好)
root@ubuntu20:/opt/installPkgs/installHarbor# vi /etc/docker/daemon.json
...
"registry-mirrors": [
"https://docker.nju.edu.cn/",
"https://kuamavit.mirror.aliyuncs.com",
"https://docker.chenby.cn",
"https://docker.registry.cyou",
"https://docker-cf.registry.cyou",
"https://dockercf.jsdelivr.fyi",
"https://docker.jsdelivr.fyi",
"https://dockertest.jsdelivr.fyi",
"https://mirror.aliyuncs.com",
"https://dockerproxy.com",
"https://mirror.baidubce.com",
"https://docker.m.daocloud.io",
"https://docker.mirrors.sjtug.sjtu.edu.cn",
"https://docker.mirrors.ustc.edu.cn",
"https://mirror.iscas.ac.cn",
"https://docker.rainbond.cc"
],
...

root@ubuntu20:/opt/installPkgs/installHarbor# systemctl daemon-reload && systemctl restart docker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#封装pull-images.sh 
root@ubuntu20:/opt/installPkgs/installHarbor# touch pull-images.sh
root@ubuntu20:/opt/installPkgs/installHarbor# cat pull-images.sh
#!/bin/bash
docker pull docker.io/bitnami/harbor-registry:2
docker pull docker.io/bitnami/harbor-registryctl:2
docker pull docker.io/bitnami/postgresql:13
docker pull docker.io/bitnami/harbor-core:2
docker pull docker.io/bitnami/harbor-portal:2
docker pull docker.io/bitnami/harbor-jobservice:2
docker pull docker.io/bitnami/redis:7.4
docker pull docker.io/bitnami/nginx:1.27

#拉取搭建Harbor时需要用到的镜像(如果上述daemon.json配置还无效,请先想办法将这些镜像下载到手)
root@ubuntu20:/opt/installPkgs/installHarbor# bash pull-images.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
#创建Harbor相关容器
root@ubuntu20:/opt/installPkgs/installHarbor# docker-compose up -d
#查看容器列表
root@ubuntu20:/opt/installPkgs/installHarbor# docker-compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
harbor-core docker.io/bitnami/harbor-core:2 "/opt/bitnami/script…" core 2 months ago Up 2 months 8080/tcp
harbor-db docker.io/bitnami/postgresql:13 "/opt/bitnami/script…" postgresql 2 months ago Up 2 months 5432/tcp
harbor-jobservice docker.io/bitnami/harbor-jobservice:2 "/opt/bitnami/script…" jobservice 2 months ago Up 2 months 8080/tcp, 8443/tcp
harbor-portal docker.io/bitnami/harbor-portal:2 "/opt/bitnami/script…" portal 2 months ago Up 2 months 8080/tcp, 8443/tcp
installharbor-redis-1 docker.io/bitnami/redis:7.4 "/opt/bitnami/script…" redis 2 months ago Up 2 months 6379/tcp
installharbor-registry-1 docker.io/bitnami/harbor-registry:2 "/opt/bitnami/script…" registry 2 months ago Up 2 months 5000/tcp
installharbor-registryctl-1 docker.io/bitnami/harbor-registryctl:2 "/opt/bitnami/script…" registryctl 2 months ago Up 2 months 8080/tcp, 8443/tcp
nginx docker.io/bitnami/nginx:1.27 "/opt/bitnami/script…" harbor-nginx 2 months ago Up 2 months 8443/tcp, 0.0.0.0:80->8080/tcp, :::80->8080/tcp

二、Harbor仓库web界面

​ Harbor仓库的web界面访问地址是:http://{服务器IP}:80 。 默认超级管理员用户:admin,密码:bitnami

​ 相关用法跟AMD64构架服务器下时Harbor的用法一样。

image-20241030224957136

​ 查看Harbor版本:

image-20241030225416541

三、其他说明

1
2
3
4
5
#相关主要配置比如登录harbor服务的web界面时admin用户的密码,在docker-compose.yml 进行配置
root@ubuntu20:/opt/installPkgs/installHarbor# vi docker-compose.yml
...
HARBOR_ADMIN_PASSWORD=bitnami
...

arm64服务器下的Harbor-v2.11.1环境搭建
https://jiangsanyin.github.io/2024/10/30/arm64服务器下的Harbor-v2-11-1环境搭建/
作者
sanyinjiang
发布于
2024年10月30日
许可协议