vmware harbor源码编译

来源:互联网 发布:linux系统模拟下载 编辑:程序博客网 时间:2024/05/01 04:36



harbor源码编译


GitHab
主页 https://github.com/vmware/harbor

1.
下载 zip,解压

wget https://github.com/vmware/harbor/archive/master.zip; unzip master.zip



2.
配置 --编辑 harbor.cfg文件

echo "54.172.***.** ip-172-30-0-20.ec2.internal" >> /etc/hosts
(说明:请更换成自己的外部可访问ip)
/usr/lib/systemd/system/docker.service
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 = reg.mydomain.com
hostname = ip-172-30-0-20.ec2.internal

使用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 docker-compose.yml harbor.cfg kubernetes log prepare 
templates

[root@ip-172-30-0-20 Deploy]# ./prepare
Generated configuration file: ./config/ui/env
Generated configuration file: ./config/ui/app.conf
Generated configuration file: ./config/registry/config.yml
Generated configuration file: ./config/db/env
Clearing the configuration file: ./config/ui/private_key.pem
Clearing the configuration file: ./config/registry/root.crt
Generated configuration file: ./config/ui/private_key.pem
Generated configuration file: ./config/registry/root.crt
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`.



0 0