一,harbor安装:
参考:Installation and Configuration Guide
1,安装docker
2,安装docker compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
3,下载二进制文件:wget https://storage.googleapis.com/harbor-releases/harbor-offline-installer-v1.5.2.tgz
4,解压缩:sudo tar xf harbor-offline-installer-v1.5.2.tgz -C /usr/local/
5,编辑:/usr/local/harbor/harbor.cfg
- hostname :自己机器的名字(用hostname可以得到),或者是IP地址。
- ui_url_protocol:http
- max_job_workers :最大并发worker进程数。
6,执行sudo ./install.sh
----Harbor has been installed and started successfully.----
7,检查端口80,443,4443是否处于被监听状态。
# netstat -tnl
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::6000 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:631 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN
tcp6 0 0 ::1:6010 :::* LISTEN
tcp6 0 0 :::443 :::* LISTEN
tcp6 0 0 :::4443 :::* LISTEN
8,在浏览器里输入自己的IP,harbor的网页应该可以显示出来。
9,使用【admin】用户名登录,密码是/usr/local/harbor/harbor.cfg里设置的。
二,使用:
必须在docker-compose.yml文件所在的目录(/usr/local/harbor)下执行。
-
暂停harbor
sudo docker-compose pause
-
恢复
sudo docker-compose unpause
-
停止
sudo docker-compose stop
-
启动
sudo docker-compose start