From 2b27f720a2e641e73db70d656bcc388bbd9b7e65 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 22 Jan 2019 18:59:50 +0000 Subject: [PATCH] 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 --- roles/build-docker-image/tasks/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }}