Skip to content

Conversation

mjbogusz
Copy link
Contributor

SUMMARY

As the title states - add docker_compose_v2_build module.

Ref #956 and discussion from #941

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

docker_compose_v2_build

ADDITIONAL INFORMATION

For now this is a draft PR with only the module itself (so e.g. any tests are missing). I've only spent a bit of time digging into the existing codebase so there might be some obvious problems/errors in my code - feel free to point them out. If this looks OK and there's some interest I'll try to find time to flesh out the missing pieces.

The module's code is heavily based upon _pull equivalent, thus I've included @felixfontein in copyrights.

Copy link

github-actions bot commented Jun 17, 2025

Docs Build 📝

Thank you for contribution!✨

The docs for this PR have been published here:
https://ansible-collections.github.io/community.docker/pr/1090

You can compare to the docs for the main branch here:
https://ansible-collections.github.io/community.docker/branch/main

The docsite for this PR is also available for download as an artifact from this run:
https://github.com/ansible-collections/community.docker/actions/runs/16241329464

File changes:

Click to see the diff comparison.

NOTE: only file modifications are shown here. New and deleted files are excluded.
See the file list and check the published docs to see those files.

The diff output was truncated because it exceeded the maximum size.

diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/changelog.html b/home/runner/work/community.docker/community.docker/docsbuild/head/changelog.html
index bdad482..a12ce82 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/changelog.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/changelog.html
@@ -552,6 +552,7 @@
 <ul>
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/current_container_facts_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/current_container_facts_module.html
index 16f1326..b985779 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/current_container_facts_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/current_container_facts_module.html
@@ -92,6 +92,7 @@
 </ul>
 </li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_api_connection.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_api_connection.html
index 8309e82..0726c01 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_api_connection.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_api_connection.html
@@ -82,6 +82,7 @@
 <ul>
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_compose_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_compose_module.html
index a83b4c4..4f3a44d 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_compose_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_compose_module.html
@@ -80,6 +80,7 @@
 <ul>
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_compose_v2_exec_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_compose_v2_exec_module.html
index f9df544..67b406e 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_compose_v2_exec_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_compose_v2_exec_module.html
@@ -23,7 +23,7 @@
     <script src="_static/js/theme.js"></script>
     <link rel="search" title="Search" href="search.html" />
     <link rel="next" title="community.docker.docker_compose_v2_pull module – Pull a Docker compose project" href="docker_compose_v2_pull_module.html" />
-    <link rel="prev" title="community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin" href="docker_compose_v2_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
+    <link rel="prev" title="community.docker.docker_compose_v2_build module – Build a Docker compose project" href="docker_compose_v2_build_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
 
 
 
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1 current"><a class="current reference internal" href="#">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a><ul>
 <li class="toctree-l2"><a class="reference internal" href="#synopsis">Synopsis</a></li>
 <li class="toctree-l2"><a class="reference internal" href="#requirements">Requirements</a></li>
@@ -692,7 +693,7 @@ will change over time. New releases of the Docker compose CLI plugin can break t
           
 
 <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
-        <a href="docker_compose_v2_module.html" class="btn btn-neutral float-left" title="community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
+        <a href="docker_compose_v2_build_module.html" class="btn btn-neutral float-left" title="community.docker.docker_compose_v2_build module – Build a Docker compose project" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
         <a href="docker_compose_v2_pull_module.html" class="btn btn-neutral float-right" title="community.docker.docker_compose_v2_pull module – Pull a Docker compose project" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
     </div>
 
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_compose_v2_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_compose_v2_module.html
index 8d751c7..5c4deb7 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_compose_v2_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_compose_v2_module.html
@@ -22,7 +22,7 @@
       <script src="_static/sphinx_highlight.js?v=dc90522c"></script>
     <script src="_static/js/theme.js"></script>
     <link rel="search" title="Search" href="search.html" />
-    <link rel="next" title="community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service" href="docker_compose_v2_exec_module.html" />
+    <link rel="next" title="community.docker.docker_compose_v2_build module – Build a Docker compose project" href="docker_compose_v2_build_module.html" />
     <link rel="prev" title="community.docker.current_container_facts module – Return facts about whether the module runs in a container" href="current_container_facts_module.html" /><!-- extra head elements for Ansible beyond RTD Sphinx Theme -->
 
 
@@ -96,6 +96,7 @@
 </li>
 </ul>
 </li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
@@ -672,8 +673,14 @@ will change over time. New releases of the Docker compose CLI plugin can break t
 <div class="admonition seealso">
 <p class="admonition-title">See also</p>
 <dl class="simple">
+<dt><a class="reference internal" href="docker_compose_v2_build_module.html#ansible-collections-community-docker-docker-compose-v2-build-module"><span class="std std-ref">community.docker.docker_compose_v2_build</span></a></dt><dd><p>Build a Docker compose project.</p>
+</dd>
+<dt><a class="reference internal" href="docker_compose_v2_exec_module.html#ansible-collections-community-docker-docker-compose-v2-exec-module"><span class="std std-ref">community.docker.docker_compose_v2_exec</span></a></dt><dd><p>Run command in a container of a Compose service.</p>
+</dd>
 <dt><a class="reference internal" href="docker_compose_v2_pull_module.html#ansible-collections-community-docker-docker-compose-v2-pull-module"><span class="std std-ref">community.docker.docker_compose_v2_pull</span></a></dt><dd><p>Pull a Docker compose project.</p>
 </dd>
+<dt><a class="reference internal" href="docker_compose_v2_run_module.html#ansible-collections-community-docker-docker-compose-v2-run-module"><span class="std std-ref">community.docker.docker_compose_v2_run</span></a></dt><dd><p>Run command in a new container of a Compose service.</p>
+</dd>
 </dl>
 </div>
 </section>
@@ -1106,7 +1113,7 @@ will change over time. New releases of the Docker compose CLI plugin can break t
 
 <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
         <a href="current_container_facts_module.html" class="btn btn-neutral float-left" title="community.docker.current_container_facts module – Return facts about whether the module runs in a container" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
-        <a href="docker_compose_v2_exec_module.html" class="btn btn-neutral float-right" title="community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
+        <a href="docker_compose_v2_build_module.html" class="btn btn-neutral float-right" title="community.docker.docker_compose_v2_build module – Build a Docker compose project" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
     </div>
 
   <hr/>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_compose_v2_pull_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_compose_v2_pull_module.html
index 64f021c..6075707 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_compose_v2_pull_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_compose_v2_pull_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1 current"><a class="current reference internal" href="#">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a><ul>
 <li class="toctree-l2"><a class="reference internal" href="#synopsis">Synopsis</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_compose_v2_run_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_compose_v2_run_module.html
index 65fe64a..142bf6f 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_compose_v2_run_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_compose_v2_run_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1 current"><a class="current reference internal" href="#">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a><ul>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_config_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_config_module.html
index 605cf22..a30dd41 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_config_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_config_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_connection.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_connection.html
index c4691c6..467a355 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_connection.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_connection.html
@@ -82,6 +82,7 @@
 <ul>
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_container_copy_into_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_container_copy_into_module.html
index 90199ce..2a09d1e 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_container_copy_into_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_container_copy_into_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_container_exec_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_container_exec_module.html
index 98bd4ae..c57a2e2 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_container_exec_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_container_exec_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_container_info_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_container_info_module.html
index f963a98..560b67f 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_container_info_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_container_info_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_container_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_container_module.html
index 51f16df..123aaa3 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_container_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_container_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_containers_inventory.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_containers_inventory.html
index 46beac2..c55bbf4 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_containers_inventory.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_containers_inventory.html
@@ -82,6 +82,7 @@
 <ul>
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module ��� Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_context_info_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_context_info_module.html
index c0d4127..9df94aa 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_context_info_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_context_info_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_host_info_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_host_info_module.html
index d93a877..d6e0c51 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_host_info_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_host_info_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_build_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_build_module.html
index ca62c8f..af0c9a7 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_build_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_build_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_export_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_export_module.html
index eaee1bb..c99d952 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_export_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_export_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_info_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_info_module.html
index 25ce148..336cf20 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_info_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_info_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_load_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_load_module.html
index 9378e87..9f58fad 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_load_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_load_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_module.html
index f8aa1cf..c02da2f 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_pull_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_pull_module.html
index 3b1963b..f8a3f6d 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_pull_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_pull_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_push_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_push_module.html
index 2562d5b..9693aa8 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_push_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_push_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_remove_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_remove_module.html
index 8b4c79d..50af8ff 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_remove_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_remove_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_tag_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_tag_module.html
index e6d6719..0946cff 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_image_tag_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_image_tag_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_login_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_login_module.html
index 074b84d..311ee2a 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_login_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_login_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_machine_inventory.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_machine_inventory.html
index aef23cb..4d3de8d 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_machine_inventory.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_machine_inventory.html
@@ -82,6 +82,7 @@
 <ul>
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_network_info_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_network_info_module.html
index e6e2ced..f102afc 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_network_info_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_network_info_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_network_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_network_module.html
index e941651..06f381f 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_network_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_network_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_node_info_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_node_info_module.html
index 07e63f2..af76b8e 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_node_info_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_node_info_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff --git a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_node_module.html b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_node_module.html
index af885d3..a8256a1 100644
--- a/home/runner/work/community.docker/community.docker/docsbuild/base/docker_node_module.html
+++ b/home/runner/work/community.docker/community.docker/docsbuild/head/docker_node_module.html
@@ -82,6 +82,7 @@
 <ul class="current">
 <li class="toctree-l1"><a class="reference internal" href="current_container_facts_module.html">community.docker.current_container_facts module – Return facts about whether the module runs in a container</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_module.html">community.docker.docker_compose_v2 module – Manage multi-container Docker applications with Docker Compose CLI plugin</a></li>
+<li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_build_module.html">community.docker.docker_compose_v2_build module – Build a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_exec_module.html">community.docker.docker_compose_v2_exec module – Run command in a container of a Compose service</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_pull_module.html">community.docker.docker_compose_v2_pull module – Pull a Docker compose project</a></li>
 <li class="toctree-l1"><a class="reference internal" href="docker_compose_v2_run_module.html">community.docker.docker_compose_v2_run module – Run command in a new container of a Compose service</a></li>
diff...*[Comment body truncated]*

Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! From a first glance, this looks good!

@mjbogusz mjbogusz force-pushed the compose-v2-build branch from 69a2af6 to f9925d7 Compare July 9, 2025 17:45
@mjbogusz
Copy link
Contributor Author

mjbogusz commented Jul 9, 2025

I've rebased my branch, applied the suggestions, added references to this module in other parts of documentation and added some preliminary unit tests.

Tests are based on the ones for the docker_compose_v2_pull module, are not exhaustive and probably not even correct as-is, as their setup is a whole rabbit-hole I only had some time to look at the surface of - hints, suggestions or even pushes to my branch are very welcome.

@felixfontein
Copy link
Collaborator

A big problem seems to be that it is impossible to figure out from the output whether the image is actually built (the actions always say "Built" and that's it, which usually means the image was already built before). Another big problem is that the image is built also in check mode, despite --dry-run being specified (this seems to be a bug in Compose; resp. it's not clear to me whether --dry-run is actually intended to be there for docker compose build - https://docs.docker.com/reference/cli/docker/compose/build/ doens't list it for example).

@felixfontein
Copy link
Collaborator

I created docker/compose#13040 for the latter. While looking at that, I also noticed that docker compose up --dry-run also builds the images. This is also a problem for the docker_compose_v2 module, since it's check mode isn't really check mode due to that...

@felixfontein
Copy link
Collaborator

The Compose issue has been closed with docker/compose#13042. Once that's released, build will simply output some generic messages which basically always say "build happened" (whether the images were actually updated or not).

Maybe we should remove check mode from this module, so that Ansible will simply skip community.docker.docker_compose_v2_build tasks in check mode - or alternatively always return changed=true. (I think the former would be more honest.)

@mjbogusz
Copy link
Contributor Author

compose v2.39.0 was released with the necessary fixes; maybe I'll manage to carve out some time to work on this next week, no promises though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants