diff --git a/roles/build-docker-image/tasks/main.yaml b/roles/build-docker-image/tasks/main.yaml index 795cbf7df..904282e14 100644 --- a/roles/build-docker-image/tasks/main.yaml +++ b/roles/build-docker-image/tasks/main.yaml @@ -1,8 +1,8 @@ - name: Build a docker image command: >- docker build {{ item.path | default('.') }} -f Dockerfile - {% if target | default(false) -%} - --target {{ target }} + {% if item.target | default(false) -%} + --target {{ item.target }} {% endif -%} {% for build_arg in item.build_args | default([]) -%} --build-arg {{ build_arg }}