docker-撰写服务版本错误
docker-compose service version error
我正在尝试从官方 docker 页面 运行 this example。
但是我收到以下错误:
ERROR: In file './docker-compose.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.
当运行执行以下命令时:
$ docker-compose run web django-admin.py startproject composeexample .
我正在使用:
$ docker-compose -version
docker-compose version 1.5.2, build 7240ff3
在 Ubuntu 16.04
通过谷歌搜索问题找不到任何有用的帖子/建议。
您的 docker-compose
太旧了。您引用的示例使用新的 "version 2" 撰写文件格式,该格式仅在 docker-compose
的最新版本(肯定是 1.7.x,也许是 1.6.x?)中受支持。
该示例的第 9 步中的示例撰写文件与您的 docker-compose
版本看起来像这样:
db:
image: postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
我正在尝试从官方 docker 页面 运行 this example。
但是我收到以下错误:
ERROR: In file './docker-compose.yml' service 'version' doesn't have any configuration options. All top level keys in your docker-compose.yml must map to a dictionary of configuration options.
当运行执行以下命令时:
$ docker-compose run web django-admin.py startproject composeexample .
我正在使用:
$ docker-compose -version
docker-compose version 1.5.2, build 7240ff3
在 Ubuntu 16.04
通过谷歌搜索问题找不到任何有用的帖子/建议。
您的 docker-compose
太旧了。您引用的示例使用新的 "version 2" 撰写文件格式,该格式仅在 docker-compose
的最新版本(肯定是 1.7.x,也许是 1.6.x?)中受支持。
该示例的第 9 步中的示例撰写文件与您的 docker-compose
版本看起来像这样:
db:
image: postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db