Compose V2 and the new docker compose command
Important
The new Compose V2,
which supports the compose command as part of the Docker CLI, is now available.
Compose V2 integrates compose functions into the Docker platform,
continuing to support most of the previous docker-compose features and flags.
You can run Compose V2 by replacing the hyphen (-) with a space,
using docker compose, instead of docker-compose.
如果你不想改变,但是想要原来的 docker-compose功能,也称为 Compose 独立 vs Compose 插件,你可以做以下事情:
# Run as root
VERSION=v2.12.2
curl -SL https://github.com/docker/compose/releases/download/$VERSION/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
chmod a+x /usr/local/bin/docker-compose
# Test it
docker-compose