华为鲲鹏云(arm64)搭建Harbor

环境介绍(因已离开原公司,文中涉及镜像已失效,请参考鲲鹏文档自行编译,后期会想办法存放在公共仓库中)

由于国产化趋势大环境,需要在鲲鹏云上部署Harbor,但是默认镜像并不支持arm架构,本文提供已经编译好所需的10个arm镜像,目前版本为1.9.1,后续有时间时在考虑升级新的版本,如需自己编译可参考鲲鹏官方文档:http://ic-openlabs.huawei.com/openlab/#/knowledgebasequery?task_id=R1S1584D00303813520191125094129756587245

一、安装Docker-ce、Docker-compose(略)

需要提前安装好Docker-ce、Docker-compose,这里就不介绍了,网上很多,yum安装就行

二、搭建Harbor

1、下载源码或者离线安装包(offline离线安装包未测试过,理论上也是可行的,注意对应版本)

[root@localhost ~]# wget https://github.com/goharbor/harbor/archive/v1.9.1.tar.gz

2、拉取镜像(共10个)

[root@localhost ~]# docker pull harbor.cq-mlkj.com/goharbor/harbor-core:v1.9.1
[root@localhost ~]# docker pull harbor.cq-mlkj.com/goharbor/harbor-db:v1.9.1
[root@localhost ~]# docker pull harbor.cq-mlkj.com/goharbor/harbor-jobservice:v1.9.1
[root@localhost ~]# docker pull harbor.cq-mlkj.com/goharbor/harbor-log:v1.9.1
[root@localhost ~]# docker pull harbor.cq-mlkj.com/goharbor/harbor-portal:v1.9.1
[root@localhost ~]# docker pull harbor.cq-mlkj.com/goharbor/harbor-registryctl:v1.9.1
[root@localhost ~]# docker pull harbor.cq-mlkj.com/goharbor/nginx-photon:v1.9.1
[root@localhost ~]# docker pull harbor.cq-mlkj.com/goharbor/prepare:v1.9.1
[root@localhost ~]# docker pull harbor.cq-mlkj.com/goharbor/redis-photon:v1.9.1
[root@localhost ~]# docker pull harbor.cq-mlkj.com/goharbor/registry-photon:v2.7.1-v1.9.1

3、更改镜像tag去掉域名

[root@localhost ~]# docker tag harbor.cq-mlkj.com/goharbor/harbor-core:v1.9.1 goharbor/harbor-core:v1.9.1
[root@localhost ~]# docker tag harbor.cq-mlkj.com/goharbor/harbor-db:v1.9.1 goharbor/harbor-db:v1.9.1
[root@localhost ~]# docker tag harbor.cq-mlkj.com/goharbor/harbor-jobservice:v1.9.1 goharbor/harbor-jobservice:v1.9.1
[root@localhost ~]# docker tag harbor.cq-mlkj.com/goharbor/harbor-log:v1.9.1 goharbor/harbor-log:v1.9.1
[root@localhost ~]# docker tag harbor.cq-mlkj.com/goharbor/harbor-portal:v1.9.1 goharbor/harbor-portal:v1.9.1
[root@localhost ~]# docker tag harbor.cq-mlkj.com/goharbor/harbor-registryctl:v1.9.1 goharbor/harbor-registryctl:v1.9.1
[root@localhost ~]# docker tag harbor.cq-mlkj.com/goharbor/nginx-photon:v1.9.1 goharbor/nginx-photon:v1.9.1
[root@localhost ~]# docker tag harbor.cq-mlkj.com/goharbor/prepare:v1.9.1 goharbor/prepare:v1.9.1
[root@localhost ~]# docker tag harbor.cq-mlkj.com/goharbor/redis-photon:v1.9.1 goharbor/redis-photon:v1.9.1
[root@localhost ~]# docker tag harbor.cq-mlkj.com/goharbor/registry-photon:v2.7.1-v1.9.1 goharbor/registry-photon:v2.7.1-v1.9.1

4、解压源码(离线版步骤一样,只是文件名和路径可能不同)

[root@localhost ~]# tar -zxvf v1.9.1.tar.gz && cd harbor-1.9.1/make

5、修改harbor.yml(自行修改端口,https,账号和密码等配置信息)

[root@localhost ~]# vi harbor.yml

6、执行install.sh安装

[root@localhost ~]# ./install.sh

7、验证

[root@localhost ~]# docker-compose ps

8、浏览器访问配置的端口测试,默认帐号密码:amdin/Harbor12345

9、停止和启动

[root@localhost ~]# docker-compose stop
[root@localhost ~]# docker-compose start

---- 结束

你可能感兴趣的:(docker,运维)