-
Notifications
You must be signed in to change notification settings - Fork 675
Open
Description
Gentlemen, I started to have issues with format templates after I upgraded docker engine from 1.12 to 1.13.
Steps to reproducte
- I run a docker service using following command
docker service create --name logspout \
--network mejai-network \
--mode global \
--mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
--env SYSLOG_HOSTNAME='{{index .Config.Labels "com.docker.swarm.service.name"}}' \
--env SYSLOG_TAG='{{.Name}}' \
--env SYSLOG_STRUCTURED_DATA='cluster={{index .Config.Labels "ca.surrey.swarm.cluster"}}' \
gliderlabs/logspout $ELK
Actual result
Error response from daemon: rpc error: code = 3 desc = expanding env failed: expanding env "SYSLOG_HOSTNAME={{index .Config.Labels \"com.docker.swarm.service.name\"}}": template: expansion:1:15: executing "expansion" at <.Config.Labels>: can't evaluate field Config in type *template.Context
But if I run docker inspect --format {{.Config.Labels}} dda42680d044
it all works.
Any ideas?
luogreen, zhaoyao91 and alex88