mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
docker_image_build: allow to specify multiple platforms, allow to specify secrets and outputs (#852)
* Add note on idempotency. * Make platform a list of strings. * Support specifying secrets. * Add test for secrets. * Support specifying outputs. * Ignore invalid choices syntax for ansible-core <= 2.16. It actually works with ansible-core 2.14+ (though not with <= 2.13), but the sanity tests only accept it from 2.17 on. * Only use --secret with type=env for buildx 0.6.0+, and multiple --output for buildx 0.13.0+.
This commit is contained in:
@@ -28,12 +28,24 @@
|
||||
- Dockerfile
|
||||
- EtcHostsDockerfile
|
||||
- MyDockerfile
|
||||
- SecretsDockerfile
|
||||
- StagedDockerfile
|
||||
|
||||
- debug:
|
||||
msg: "Has buildx plugin: {{ docker_has_buildx }}"
|
||||
|
||||
- block:
|
||||
- name: Determine plugin versions
|
||||
command: docker info -f '{{ "{{" }}json .ClientInfo.Plugins{{ "}}" }}'
|
||||
register: plugin_versions
|
||||
|
||||
- name: Determine buildx plugin version
|
||||
set_fact:
|
||||
buildx_version: >-
|
||||
{{
|
||||
(plugin_versions.stdout | from_json | selectattr('Name', 'eq', 'buildx') | map(attribute='Version') | first).lstrip('v')
|
||||
}}
|
||||
|
||||
- include_tasks: run-test.yml
|
||||
with_fileglob:
|
||||
- "tests/*.yml"
|
||||
|
||||
Reference in New Issue
Block a user