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.
This commit is contained in:
Steve Baker 2018-05-11 13:05:24 +12:00
parent 1cd88ae972
commit 3eea261326
1 changed files with 3 additions and 5 deletions

View File

@ -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 }}"