1. ./install.sh

[root@harbor harbor]# ./install.sh 

[Step 0]: checking if docker is installed ...

Note: docker version: 23.0.1

[Step 1]: checking docker-compose is installed ...
✖ Need to install docker-compose(1.18.0+) by yourself first and run this script again.

2.新版语法docker compose version

[root@harbor harbor]# docker compose version
Docker Compose version v2.16.0

3.原因是旧版配置文件未更新语法

编辑common.sh文件

[root@harbor harbor]# ls
common.sh  harbor.v2.1.0.tar.gz  harbor.yml  harbor.yml.tmpl  install.sh  LICENSE  prepare
[root@harbor harbor]# vim common.sh 
  1. 选中docker compose

function check_dockercompose {
        if ! docker-compose --version &> /dev/null
        then
                error "Need to install docker-compose(1.18.0+) by yourself first and run this script again."
                exit 1
        fi

改docker-compose --version 为 docker compose version

function check_dockercompose {
        if ! docker compose version &> /dev/null
        then
                error "Need to install docker-compose(1.18.0+) by yourself first and run this script again."
                exit 1
        fi

更多推荐