我有像这样的docker-compose.yml文件
version: '2'
services:
my-service-one:
// parameters of my-service-one
my-service-two:
extends: my-service-one
//extra params for my-service-two
my-service-three
extends: my-service-one
//extra params for my-service-three
我想只使用ansible docker_service module
启动其中一项服务,例如my-service-three我相信它会是这样的:
docker_service:
project_src: /path/to/dir/containing/docker-compose.yml
some-parameter: my-service-three
在docker_service模块中设置的仅运行一个服务的参数是什么?
答案 0 :(得分:3)
该文档确实提到了services
参数,但没有明显提及。
当状态存在时,运行docker-组成一部分服务。
docker_service:
project_src: /path/to/dir/containing/docker-compose.yml
services:
- my_service
state: present