docker-compose with with yml confs不会启动

时间:2016-12-26 16:56:10

标签: docker docker-compose

这是我项目的树形结构:

.
├── backend-codebase
│   ├── app.js
│   ├── bin
│   │   └── www
│   ├── config.js
│   ├── db
│   │   ├── index.js
│   │   ├── repos
│   │   │   └── todos.js
│   │   └── sql
│   │       ├── index.js
│   │       └── todos
│   ├── dev
│   │   └── postgres
│   ├── index.js
│   ├── package.json
│   ├── public
│   │   ├── images
│   │   ├── javascripts
│   │   └── stylesheets
│   │       └── style.css
│   ├── routes
│   │   ├── api.js
│   │   ├── index.js
│   │   └── users.js
│   ├── scripts
│   │   ├── applyFixtures.js
│   │   ├── dev_entrypoint.sh
│   │   ├── fixtures.json
│   │   └── psql_dump.sql
│   ├── views
│   │   ├── api.ejs
│   │   ├── db.ejs
│   └── yarn.lock
├── dev
│   ├── Dockerfile-node
│   ├── Dockerfile-postgres
│   ├── development.sh
│   ├── docker-compose-common.yml
│   ├── docker-compose-dev.yml
│   └── postgres
│       ├── 12-12-2016_16_58_59.dump
...

我使用docker-compose来创建三个容器并对所有内容进行处理: - 节点服务器 - 一个postgres数据库 - 数据库的数据容器

另外,我在/dev/docker-compose-*.yml下创建了两个(并且缺少第三个)yaml文件。 docker-compose-dev扩展了常见的,并且应该构建图像以及运行所有图像。

为了开始尝试启动以下内容的所有内容:

$ docker-compose up --file dev/docker-compose-common.yml --file dev/docker-compose-dev.yml

但我得到的是这个输出:

Builds, (re)creates, starts, and attaches to containers for a service.

Unless they are already running, this command also starts any linked services.

The `docker-compose up` command aggregates the output of each container. When
the command exits, all cont

我真的不明白我做错了什么

1 个答案:

答案 0 :(得分:0)

傻,傻,我。 这只是参数和命令之间的顺序倒置。

另外,我可以删除第一个--file参数,因为它是使用extends yaml键引用的。

docker-compose -f dev/docker-compose-dev.yml up
相关问题