vmware harbor源码编译

时间:2024-10-22 17:34:30



harbor源码编译


GitHab
主页 /vmware/harbor

1.
下载 zip , 解压

wget /vmware/harbor/archive/; unzip



2.
配置 -- 编辑 文件

echo "54.172.***.** ip-172-30-0-20." >> /etc/hosts
(说明:请更换成自己的外部可访问ip)
/usr/lib/systemd/system/
ExecStart=/usr/bin/docker daemon -H fd:// --insecure-registry172.30.0.20:5000

2.1
进入 Deploy 目录
[root@ip-172-30-0-20 harbor-master]# cd harbor-master/Deploy/
[root@ip-172-30-0-20 Deploy]#

2.2
修改参数
hostname:
(必须修改)
#hostname =
hostname = ip-172-30-0-20.

使用HTTP模式,
其他参数,暂不修改。

 

2.3 prepare
, 生成配置文件
[root@ip-172-30-0-20 ~]# cd /home/gopath/harbor-master/Deploy/
[root@ip-172-30-0-20 Deploy]# ls
config  db     kubernetes  log  prepare 
templates

[root@ip-172-30-0-20 Deploy]# ./prepare
Generated configuration file: ./config/ui/env
Generated configuration file: ./config/ui/
Generated configuration file: ./config/registry/
Generated configuration file: ./config/db/env
Clearing the configuration file: ./config/ui/private_key.pem
Clearing the configuration file: ./config/registry/
Generated configuration file: ./config/ui/private_key.pem
Generated configuration file: ./config/registry/
The configuration files are ready, please use docker-compose to start theservice.



2.4 启动
sudo docker-compose up -d



2.5 生成镜像

。。。。。。。。。。。

(省略)

Step 15 : EXPOSE 80
 ---> Running in 1c1413800b79
 ---> 668989cf111b
Removing intermediate container 1c1413800b79
Successfully built 668989cf111b
WARNING: Image for service ui was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.