我正在尝试在 debian 上安装最新的 docker compose,以便我可以使用 newinclude
关键字,但 apt info 和docker compose version
.
我已将 docker 存储库添加到我的sources.list
:
$ cat /etc/apt/sources.list.d/docker.list
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bookworm stable
apt 正在从 docker 存储库安装软件包:
$ sudo apt policy docker-compose-plugin
docker-compose-plugin:
Installed: 2.25.0-1~debian.12~bookworm
Candidate: 2.25.0-1~debian.12~bookworm
Version table:
*** 2.25.0-1~debian.12~bookworm 500
500 https://download.docker.com/linux/debian bookworm/stable amd64 Packages
100 /var/lib/dpkg/status
$ apt policy docker-ce
docker-ce:
Installed: 5:26.0.0-1~debian.12~bookworm
Candidate: 5:26.0.0-1~debian.12~bookworm
Version table:
*** 5:26.0.0-1~debian.12~bookworm 500
500 https://download.docker.com/linux/debian bookworm/stable amd64 Packages
100 /var/lib/dpkg/status
但docker compose version
确实显示了旧的:
$ docker compose version
Docker Compose version v2.2.3
相反,docker
显示了正确的版本:
$ docker --version
Docker version 26.0.0, build 2ae903e
我是否需要docker compose
通过其他方法安装才能获得更新的功能?
编辑:正如答案中所建议的,我docker-compose
在其中一个二进制文件夹中发现了过时的版本(~/.docker/cli-plugins
)
如果您在这些目录之一中有过时的版本
docker-compose
,则它可能会优先:如果您有旧的
docker-compose
,请尝试将其删除。这应该允许安装的版本docker-compose-plugin
生效。来源:https://github.com/docker/compose/issues/11100#issuecomment-1771726824