Docker使用Golang模板变量撰写文件

时间:2017-10-11 04:20:16

标签: go docker-compose

我想用一些东西:

version: '3.3'
services:
    nginx:
        image: nginx:alpine
        environment:
           - TEMP123='{{ range $key, $value := . }}{{ $key }}{{end}}'

我得到了结果:

failed to create service nginx_nginx: Error response from daemon: rpc error: code = InvalidArgument desc = expanding env failed: expanding env "TEMP123='{{ range ,  := . }}{{  }}{{end}}'": template: expansion:1: unexpected "," in range

可能我需要屏蔽符号' $' ?

0 个答案:

没有答案