From 3eea2613267575f8dd6a1e79f90386871d024074 Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Fri, 11 May 2018 13:05:24 +1200 Subject: [PATCH] Use command instead of docker_image for docker build The docker_image module doesn't support --network host, which is required for the yum update to reach the network. --- tasks/modify_image.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tasks/modify_image.yml b/tasks/modify_image.yml index 57ef93d..a178b91 100644 --- a/tasks/modify_image.yml +++ b/tasks/modify_image.yml @@ -31,8 +31,6 @@ line: "LABEL modified_append_tag={{ modified_append_tag }}" - name: Modify image - docker_image: - name: "{{ target_image | default(source_image) }}{{ modified_append_tag }}" - path: "{{ modify_dir_path }}" - dockerfile: Dockerfile.modified - + command: docker build --tag {{ target_image | default(source_image) }}{{ modified_append_tag }} --file Dockerfile.modified --network host ./ + args: + chdir: "{{ modify_dir_path }}"