Skip to contentSkip to conversation

tools/build-docs-container: use CONTAINERCMD to append args

PATCH Superseded Antonin Godard 2 participants 3 messages Oct 9, 2025 – Oct 13, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/build-docs-container: use CONTAINERCMD to append args

What we have is OCI = $(which $CONTAINERCMD) = /usr/bin/{docker,podman}. So we never pass these if conditions. Compare against CONTAINERCMD instead.

---
 documentation/tools/build-docs-container | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
documentation/tools/build-docs-container +2 -2
index 70e05f295..a93e0668b 100755
@@ -157,11 +157,11 @@ main ()
     --security-opt label=disable
   )
 
-  if [ "$OCI" = "docker" ]; then
+  if [ "$CONTAINERCMD" = "docker" ]; then
     args_run+=(
       --user="$(id -u)":"$(id -g)"
     )
-  elif [ "$OCI" = "podman" ]; then
+  elif [ "$CONTAINERCMD" = "podman" ]; then
     # we need net access to fetch bitbake terms
     args_run+=(
       --cap-add=NET_RAW

---
base-commit: 09c7800333b17b21e50d2a089a3ae1b123697243
change-id: 20251009-fix-build-docs-container-args-d50c9ecbf7bf

Best regards,

Signature · 1 line
Antonin Godard <[email protected]>
#1 lore raw

Hi Antonin,

Quoted 4 lines · Antonin Godard via lists.yoctoproject.org

What we have is OCI = $(which $CONTAINERCMD) = /usr/bin/{docker,podman}. So we never pass these if conditions. Compare against CONTAINERCMD instead.

Nope, this won't work if you call the script with docker but run with podman. This would be the case if you have podman-docker package installed on fedora for example, c.f. https://packages.fedoraproject.org/pkgs/podman/podman-docker/.

So we do really want to test OCI I think.

A few options:
- "$(basename "$OCI")"
- if [[ "$OCI" =~ "/docker$" ]];
elif [[ "$OCI" =~ "/podman$" ]]
c.f.
https://www.gnu.org/software/bash/manual/html_node/Conditional-Constructs.html#index-_005b_005b
- if echo "$OCI" | grep -q -w docker; then
elif echo "$OCI" | grep -q -w podman; then

This script has worked fine for me with podman-docker script with only podman installed on my system, can you tell me what the issue is so we're sure we're fixing the issues?

Cheers,
Quentin

#2 lore raw
Quoted 6 lines · Quentin Schulz via lists.yoctoproject.org

Hi Antonin,

Quoted 3 lines · Antonin Godard via lists.yoctoproject.org

What we have is OCI = $(which $CONTAINERCMD) = /usr/bin/{docker,podman}. So we never pass these if conditions. Compare against CONTAINERCMD instead.

Quoted 6 lines
Quoted 1 line

Nope, this won't work if you call the script with docker but run with podman. This would be the case if you have podman-docker package installed on fedora for example, c.f.
https://packages.fedoraproject.org/pkgs/podman/podman-docker/.

Oh I see... I did not guess that.

I'll send a v2.

Thanks,
Antonin

Signature · 3 lines
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com