Compose: Service template support

Created on 27 Jun 2017  路  4Comments  路  Source: docker/compose

With the recent addition of service templates such as:

$ docker service create --name hosttempl \
                        --hostname="{{.Node.ID}}-{{.Service.Name}}"\
                         busybox top

https://docs.docker.com/engine/reference/commandline/service_create/#create-services-using-templates

Does docker compose support this as well? If not, are there plans to add it in? I have a few use cases where this would be really helpful. Thanks!

kinquestion

Most helpful comment

@shin- Would you mind explaining why that is that makes templates suited only for command line use? I will try to describe my use case:

I use compose files for my stacks, and I would like to use docker stack deploy -c compose.yml mystack and have the service specified in compose.yml with templates and all rather than rolling out my own bash or python script for creating those few services for which I need templates.

All 4 comments

Unlikely - all those options are very specific to Swarm and Swarm services, which Compose does not support.

@shin- Would you mind explaining why that is that makes templates suited only for command line use? I will try to describe my use case:

I use compose files for my stacks, and I would like to use docker stack deploy -c compose.yml mystack and have the service specified in compose.yml with templates and all rather than rolling out my own bash or python script for creating those few services for which I need templates.

@shin- is it actually docker/compose or docker/cli which implements stack deployment support?

This would be very nice feature to have but of course we want open issue to correct place.

@olljanat docker/cli is where development on docker stack happens.

Was this page helpful?
0 / 5 - 0 ratings