services: {%- set components = cookiecutter.component_s_canon.split(',') -%} {% for component in components %} {{ component }}-build: image: "{{ component }}:${% raw %}{{% endraw %}{{ component.upper() }}_VERSION{% raw %}}{% endraw %}" profiles: ["build", "build-{{ component }}"] build: context: "build-context/{{ component }}" dockerfile: Dockerfile args: EXAMPLE_ARG_FOR_DOCKERFILE: ${EXAMPLE_ARG_FROM_ENV_FILE} {%- endfor %}