28 lines
758 B
YAML
28 lines
758 B
YAML
- import_tasks: precheck.yml
|
|
tags:
|
|
- always
|
|
|
|
- name: Copy Dockerfile to Dockerfile.modified
|
|
copy:
|
|
src: "{{ modify_dir_path }}/Dockerfile"
|
|
dest: "{{ modify_dir_path }}/Dockerfile.modified"
|
|
|
|
- name: Replace FROM directive
|
|
lineinfile:
|
|
path: "{{ modify_dir_path }}/Dockerfile.modified"
|
|
regexp: "^FROM "
|
|
line: "FROM {{ source_image }}"
|
|
|
|
- name: Add LABEL modified_append_tag={{ modified_append_tag }}
|
|
lineinfile:
|
|
path: "{{ modify_dir_path }}/Dockerfile.modified"
|
|
insertafter: "^FROM "
|
|
line: "LABEL modified_append_tag={{ modified_append_tag }}"
|
|
|
|
- name: Modify image
|
|
docker_image:
|
|
name: "{{ modified_image_prefix }}{{ modified_append_tag }}"
|
|
path: "{{ modify_dir_path }}"
|
|
dockerfile: Dockerfile.modified
|
|
|