Open mkubilus opened 5 years ago
Hi @mkubilus
There are some advanced templating features in the experimental build that you may want to try out. For example, you would be able to write the following docker-compose.yml
file:
version: '3.5'
services:
atest:
image: abc
command: echo test
volumes:
{{range $i, $v := .myvols}}
- {{$v}}
{{end}}
and render using the following command:
DOCKERAPP_RENDERERS=gotemplate docker-app render
Resulting in the following:
version: "3.5"
services:
atest:
command:
- echo
- test
image: abc
volumes:
- type: bind
source: /tmp
target: /tmp
- type: volume
source: avol
target: /amount
I'd love to see this feature available. Just wondering, for cases where only the values of the list (here myvols
) are rendered, why not being able to just write volumes: ${myvols}
?
Description
When rendering it would be useful to specify more complex substitutions from settings.yml rather than being restricted to only single items.
For instance, I should be able to specify a list of volumes in settings perhaps like so:
and in my docker-compose.yml template refer to this:
Steps to reproduce the issue:
Describe the results you received:
Error: failed to load Compose file: invalid interpolation format for services.atest.volumes: "required variable myvols is missing a value". You may need to escape any $ with another $.
Describe the results you expected: render completes successfully.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker-app version
:Output of
docker info
: