./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 选中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
文章描述了在尝试运行Harbor的安装脚本时遇到的问题,即脚本检查的是旧版docker-compose的版本,而系统中安装的是新版。解决方案是修改安装脚本中的检查命令,将`docker-compose--version`更改为`dockercomposeversion`,以适应新版docker-compose的语法。
1589





