docker-compose --x-networking up 不起作用

标签 docker docker-compose

我正在尝试设置 docker-compose 网络但命令

docker-compose --x-networking up

返回标准 docker-compose 帮助输出
Define and run multi-container applications with Docker.

Usage:
  docker-compose [-f=<arg>...] [options] [COMMAND] [ARGS...]
  docker-compose -h|--help

Options:
  -f, --file FILE           Specify an alternate compose file (default: docker-compose.yml)
  -p, --project-name NAME   Specify an alternate project name (default: directory name)
  --verbose                 Show more output
  -v, --version             Print version and exit

Commands:
  build              Build or rebui...
  (etc)

知道为什么吗?

最佳答案

这取决于您使用的 docker-compose 版本。 1.5 之前的版本没有这个标志。如果您使用的是 1.6; --x-networking标志在 1.6 中不再存在,因为如果您的 docker-compose.yml 现在会自动使用它使用 2.0 格式

release notes ;

Support for networking has exited experimental status and is the recommended way to enable communication between containers.

If you use the new file format, your app will use networking. If you want to keep using links, just leave your Compose file as it is and it'll continue to work just the same.

By default, you don't have to configure any networks. In fact, using networking with Compose involves even less configuration than using links. Consult the networking guide for how to use it: https://github.com/docker/compose/blob/1.6.0-rc1/docs/networking.md

The experimental flags --x-networking and --x-network-driver, introduced in Compose 1.5, have been removed.

关于docker-compose --x-networking up 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35033050/

相关文章:

docker - 如何在 debian Jessie 上安装 docker-engine 1.13

docker - 如何使用 docker-compose 构建 Dockerfiles?

docker - 从零开始创建新镜像,没有任何入口点

docker - Docker Hub 和 Quay.io 有什么区别?

docker - 具有不同配置的Docker服务的多个实例

django - PermissionError:[Errno 13]尝试使用docker-compose创建项目时,权限被拒绝: '/app/manage.py'

docker - 无法使用 kompose 从 docker-compose 转换为 kubernetes

node.js - docker找不到模块 'Sequelize'

docker - 将 docker 卷导出到另一台机器

docker - 在 docker run 命令中更改 ulimit 值