fix: support both docker-compose v1 and docker compose v2 (#22581)

fix: resolve 'docker-compose: command not found' error

Add fallback to support Docker Compose V2 plugin format when
standalone docker-compose binary is not available.

Signed-off-by: coldenchen <coldenchen@tencent.com>
Co-authored-by: coldenchen <coldenchen@tencent.com>
This commit is contained in:
Coldchen99 2025-11-26 14:00:57 +08:00 committed by GitHub
parent 26f6310fbc
commit 8c3f0c6d4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -140,7 +140,7 @@ DOCKERRMIMAGE=$(DOCKERCMD) rmi
DOCKERPULL=$(DOCKERCMD) pull
DOCKERIMAGES=$(DOCKERCMD) images
DOCKERSAVE=$(DOCKERCMD) save
DOCKERCOMPOSECMD=$(shell which docker-compose)
DOCKERCOMPOSECMD=$(shell which docker-compose 2>/dev/null || echo "docker compose")
DOCKERTAG=$(DOCKERCMD) tag
# go parameters