diff mbox series

[7/8] tools/build-docs-container: allow passing extra args to $OCI run

Message ID 20251222-concurrent-safety-v1-7-e3d86e44cd38@bootlin.com
State New
Headers show
Series Parallel docs build improvements | expand

Commit Message

Antonin Godard Dec. 22, 2025, 12:27 p.m. UTC
Add a OCI_RUN_EXTRA_ARGS env variable to allow customizing the arguments
passed to the podman/docker run command. For example:

  export OCI_RUN_EXTRA_ARGS="--env=SPHINXOPTS=-W --keep-going -j1"

To limit the number of threads used by Sphinx. This is especially useful
for parallel builds.

Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
---
 documentation/tools/build-docs-container | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/documentation/tools/build-docs-container b/documentation/tools/build-docs-container
index 7a5191710..c5cdd9c4c 100755
--- a/documentation/tools/build-docs-container
+++ b/documentation/tools/build-docs-container
@@ -25,6 +25,7 @@  CONTAINERCMD=${CONTAINERCMD:-docker}
 DOCS_DIR="$SCRIPT_DIR/../.."
 INCLUDE_ESSENTIAL_PACKAGES=${INCLUDE_ESSENTIAL_PACKAGES:-0}
 RUN_NON_INTERACTIVE="${RUN_NON_INTERACTIVE:-0}"
+OCI_RUN_EXTRA_ARGS="${OCI_RUN_EXTRA_ARGS:-}"
 
 function usage()
 {
@@ -69,6 +70,8 @@  $0 OCI_IMAGE [make arguments...]
 
    - RUN_NON_INTERACTIVE: when set to 1, allow the '\$OCI run' command to be run
      non-interactively, without a tty.
+
+   - OCI_RUN_EXTRA_ARGS: extra arguments to pass to the '\$OCI run' command.
 "
 }
 
@@ -210,6 +213,9 @@  main ()
     )
   fi
 
+  # Extra arguments.
+  [ -n "$OCI_RUN_EXTRA_ARGS" ] && args_run+=( "${OCI_RUN_EXTRA_ARGS}" )
+
   $OCI run \
     "${args_run[@]}" \
     "$image_sha" \