系统环境:
- Centos7.9
- Docker-ce:24
安装Docker-Compose
curl -L "https://github.com/docker/compose/releases/download/v2.20.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
添加执行权限并验证
[root@node4 ~]# chmod +x /usr/local/bin/docker-compose
[root@node4 ~]# docker-compose --version
Docker Compose version v2.20.3
下载并安装Harber
#下载harbor
wget https://github.com/goharbor/harbor/releases/download/v2.8.4/harbor-offline-installer-2.8.4.tgz
#解压
tar -xzf harbor-offline-installer-v2.8.4.tgz -C /usr/local/
修改配置文件
[root@node4 ~]# cd /usr/local/harbor/
[root@node4 harbor]# ll
total 597560
drwxr-xr-x 3 root root 20 Aug 20 07:04 common
-rw-r--r-- 1 root root 3639 Aug 15 17:53 common.sh
-rw-r--r-- 1 root root 5834 Aug 20 07:07 docker-compose.yml
-rw-r--r-- 1 root root 611834153 Aug 15 17:54 harbor.v2.8.4.tar.gz
-rw-r--r-- 1 root root 12492 Aug 20 07:03 harbor.yml
-rw-r--r-- 1 root root 12499 Aug 15 17:53 harbor.yml.tmpl
-rwxr-xr-x 1 root root 2725 Aug 15 17:53 install.sh
-rw-r--r-- 1 root root 11347 Aug 15 17:53 LICENSE
-rwxr-xr-x 1 root root 1881 Aug 15 17:53 prepare
[root@node4 harbor]# vim harbor.yml
主要修改了: hostname:主机名
max_job_workers:最大cpu数,小于等于自己服务器的硬件
启动Harbor
[root@node4 harbor]# ./install.sh
使用Harbor
浏览器访问:ip:/harbor/sign-in
使用admin登录,密码为Harbor12345(初始密码在harbor.cfg 文件有记录)
新建一个项目