项目地址
    https://github.com/docker/compose
    https://github.com/goharbor/harbor

    下载
    wget https://github.com/docker/compose/releases/download/1.26.0/docker-compose-Linux-x86_64

    sudo mv docker-compose-Linux-x86_64 /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose

    1. [rancher@rmaster02 ~]$ docker-compose version
    2. docker-compose version 1.26.0, build d4451659
    3. docker-py version: 4.2.1
    4. CPython version: 3.7.7
    5. OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
    6. [rancher@rmaster02 ~]$
    1. [rancher@rmaster02 home]$ ll
    2. total 488972
    3. -rw-r--r-- 1 root root 500705880 Jun 7 08:57 harbor-offline-installer-v2.0.0.tgz
    4. drwx------. 2 login01 login01 62 Jan 11 13:41 login01
    5. drwx------ 4 rancher rancher 107 Jun 7 08:53 rancher
    6. [rancher@rmaster02 home]$ sudo tar xf harbor-offline-installer-v2.0.0.tgz
    7. [rancher@rmaster02 home]$ cd /home/harbor/
    8. [rancher@rmaster02 harbor]$ ll
    9. total 491056
    10. -rw-r--r-- 1 root root 3361 May 11 18:47 common.sh
    11. -rw-r--r-- 1 root root 502808042 May 11 18:48 harbor.v2.0.0.tar.gz
    12. -rw-r--r-- 1 root root 7816 May 11 18:47 harbor.yml.tmpl
    13. -rwxr-xr-x 1 root root 2523 May 11 18:47 install.sh
    14. -rw-r--r-- 1 root root 11347 May 11 18:47 LICENSE
    15. -rwxr-xr-x 1 root root 1856 May 11 18:47 prepare
    16. [rancher@rmaster02 harbor]$

    重命名 harbor.yml.tmpl 为 harbor.yml
    修改文件内容

    1. hostname: 192.168.11.101
    2. # http related config
    3. http:
    4. # port for http, default is 80. If https enabled, this port will redirect to https port
    5. port: 80
    6. # https related config
    7. #https:
    8. # https port for harbor, default is 443
    9. # port: 443
    10. # The path of cert and key files for nginx
    11. # certificate: /your/certificate/path
    12. # private_key: /your/private/key/path

    开始部署

    1. ./install.sh --with-trivy --with-clair
    1. [root@rmaster02 ~]#
    2. [root@rmaster02 ~]# cd /home/harbor/
    3. [root@rmaster02 harbor]#
    4. [root@rmaster02 harbor]# ll
    5. total 491056
    6. -rw-r--r-- 1 root root 3361 May 11 18:47 common.sh
    7. -rw-r--r-- 1 root root 502808042 May 11 18:48 harbor.v2.0.0.tar.gz
    8. -rw-r--r-- 1 root root 7818 Jun 7 09:03 harbor.yml
    9. -rwxr-xr-x 1 root root 2523 May 11 18:47 install.sh
    10. -rw-r--r-- 1 root root 11347 May 11 18:47 LICENSE
    11. -rwxr-xr-x 1 root root 1856 May 11 18:47 prepare
    12. [root@rmaster02 harbor]# ./install.sh --with-trivy --with-clair
    13. [root@rmaster02 harbor]# docker-compose ps
    14. Name Command State Ports
    15. ------------------------------------------------------------------------------------------------------
    16. harbor-core /harbor/entrypoint.sh Up (health: starting)
    17. harbor-db /docker-entrypoint.sh Up (health: starting) 5432/tcp
    18. harbor-jobservice /harbor/entrypoint.sh Up (health: starting)
    19. harbor-log /bin/sh -c /usr/local/bin/ ... Up (health: starting) 127.0.0.1:1514->10514/tcp
    20. harbor-portal nginx -g daemon off; Up (health: starting) 8080/tcp
    21. nginx nginx -g daemon off; Up (health: starting) 0.0.0.0:80->8080/tcp
    22. redis redis-server /etc/redis.conf Up (health: starting) 6379/tcp
    23. registry /home/harbor/entrypoint.sh Up (health: starting) 5000/tcp
    24. registryctl /home/harbor/start.sh Up (health: starting)
    25. [root@rmaster02 harbor]#

    image.png