运行“docker-组合时出错

Error while running "docker-compose up

我收到错误 "ERROR: client and server don't have same version (client : 1.21, server: 1.18)"

所以我 运行 命令 "export COMPOSE_API_VERSION=1.18" 现在我得到了不同的错误。

Traceback (most recent call last):
File "<string>", line 3, in <module>
File "compose/cli/main.py", line 61, in main
File "compose/cli/main.py", line 113, in perform_command
File "compose/cli/main.py", line 835, in up
File "compose/project.py", line 374, in up
File "compose/project.py", line 415, in initialize
File "compose/network.py", line 162, in initialize
File "compose/network.py", line 47, in ensure
File "compose/network.py", line 82, in inspect
File "site-packages/docker/utils/decorators.py", line 32, in wrapper
docker.errors.InvalidVersion: inspect_network is not available for version < 1.21
docker-compose returned -1

我的 docker-compose 文件可以在 gist

Docker 版本:Docker 版本 1.12.0,构建 8eab29e

Docker-compose : docker-compose version 1.8.0, build f3628c7

Ubuntu 14.04 64 位。

如有任何帮助,我们将不胜感激。谢谢

您是 运行 本地最新版本的 docker (1.12) 和 docker-compose (1.8.0)。错误消息暗示您可能正在远程服务器上启动容器? (以 docker-machine 开头?)

我建议在目标服务器上升级 docker 运行 的版本。

COMPOSE_API_VERSION variable 上的文档指出它只能用作变通方法。

Setting this variable is intended as a workaround for situations where you need to run temporarily with a mismatch between the client and server version. For example, if you can upgrade the client but need to wait to upgrade the server.

Running with this variable set and a known mismatch does prevent some Docker features from working properly. The exact features that fail would depend on the Docker client and server versions. For this reason, running with this variable set is only intended as a workaround and it is not officially supported.

If you run into problems running with this set, resolve the mismatch through upgrade and remove this setting to see if your problems resolve before notifying support.