Browse Source

Pull target from item in build image

In the image building loop, the loop variable is 'item' - which is
where target is located.

Change-Id: I4c9e612f58c1fd92a32da1888af195f17cb821eb
changes/28/632528/1
Monty Taylor 6 months ago
parent
commit
2b27f720a2
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      roles/build-docker-image/tasks/main.yaml

+ 2
- 2
roles/build-docker-image/tasks/main.yaml View File

@@ -1,8 +1,8 @@
1 1
 - name: Build a docker image
2 2
   command: >-
3 3
     docker build {{ item.path | default('.') }} -f Dockerfile
4
-    {% if target | default(false) -%}
5
-      --target {{ target }}
4
+    {% if item.target | default(false) -%}
5
+      --target {{ item.target }}
6 6
     {% endif -%}
7 7
     {% for build_arg in item.build_args | default([]) -%}
8 8
       --build-arg {{ build_arg }}

Loading…
Cancel
Save