获取docker-compose二进制文件
下载docker-compose二进制文件
wget https://github.com/docker/compose/releases/download/1.25.0/docker-compose-Linux-x86_64
移动二进制文件到 /usr/bin 目录,并要根本更名为docker-compose
[root@localhost ~]# mv docker-compose-Linux-x86_64 /usr/bin/docker-compose
添加执行权限
[root@localhost ~]# chmod +x /usr/bin/docker-compose
安装完成后,查看docker-compse版本
[root@localhost ~]# docker-compose -v
docker-compose version 1.25.0, build 0a186604
博主自己下载来了,方便广大用户。点击下载
获取harbor安装文件
直接去github上找最新的harbor release tar包,安装包比较大,博主方便大家下载下来了。点击下载
wget https://github.com/goharbor/harbor/releases/download/v2.7.1/harbor-offline-installer-v2.7.1.tgz
修改harbor配置文件进行安装
[root@localhost ~]# tar -zxvf harbor-offline-installer-v2.7.1.tgz
[root@localhost ~]# cd harbor/
[root@localhost harbor]# mv harbor.yml.tmpl harbor.yml
[root@localhost harbor]# vim harbor.yml
hostname 写自己的ip地址或者搞个域名解析都行
去掉https相关的代码
自行修改harbor的密码,启动后再修改就不生效了
[root@localhost harbor]# ./prepare
[root@localhost harbor]# ./install.sh
最关键的两条命令,可以看到系统给我们安装了10
[+] Running 10/10
✔ Network harbor_harbor Created
✔ Container harbor-log Started
✔ Container registryctl Started
✔ Container harbor-db Started
✔ Container redis Started
✔ Container registry Started
✔ Container harbor-portal Started
✔ Container harbor-core Started
✔ Container nginx Started
✔ Container harbor-jobservice Started
----Harbor has been installed and started successfully.----
验证是否安装完毕
在浏览器上输入: http://192.168.3.125
维护
要修改harbor.yml文件
1、先停止使用docker-compose down
,再修改harbor.yml文件,重新启动部署 ./install.sh
2、正常启动harbor docker-compose up -d
没有改配置文件
重启Harbor命令
docker-compose start
docker-compose stop
docker-compose restart