From aeca2b864b1a8176cf3374222d6b8a08159ff323 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 9 Dec 2024 20:00:00 +0100 Subject: [PATCH 1/2] Add note on strange behavior. --- plugins/modules/docker_image_build.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/modules/docker_image_build.py b/plugins/modules/docker_image_build.py index f2dcc9f45..fe1c64f1b 100644 --- a/plugins/modules/docker_image_build.py +++ b/plugins/modules/docker_image_build.py @@ -175,6 +175,10 @@ be created, which can cause the basic idempotency this module offers to not work. - Providing an empty list to this option is equivalent to not specifying it at all. The default behavior is a single entry with O(outputs[].type=image). + - B(Note) that for some reason Docker the buildx plugin overwrites the image name + of every entry with O(outputs[].type=image), O(outputs[].type=oci), or O(outputs[].type=docker) + with the image name specified in O(name)/O(tag). We will not work around this in community.docker 3.x.y + for backwards compatibility. Please upgrade to community.docker 4.2.0 or newer for a workaround. type: list elements: dict version_added: 3.10.0 From b87bdc2101a2c58ae6d5f3c50b9c8c7283dc857e Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 9 Dec 2024 20:04:59 +0100 Subject: [PATCH 2/2] Document strange behavior in changelog. --- changelogs/fragments/1007-build-output.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelogs/fragments/1007-build-output.yml diff --git a/changelogs/fragments/1007-build-output.yml b/changelogs/fragments/1007-build-output.yml new file mode 100644 index 000000000..7811e18d4 --- /dev/null +++ b/changelogs/fragments/1007-build-output.yml @@ -0,0 +1,6 @@ +known_issues: + - "docker_image_build - when ``outputs`` is specified, all entries with ``type=image``, ``type=oci`` and ``type=docker`` have their + name overwritten by the values provided in ``name`` and ``tag``. This happens because the module provides the ``--tag`` option + with the values of the ``name`` and ``tag`` options to Docker the buildx plugin, which for some reason takes that value and + uses it to overwrite the values in ``--output`` parameters + (https://github.com/ansible-collections/community.docker/issues/1001, https://github.com/ansible-collections/community.docker/pull/1007)."