All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] utils/docker-run: allow explicitly setting of docker/podman/...
@ 2025-02-16 17:03 Yann E. MORIN
  2025-02-17 12:13 ` Fiona Klute via buildroot
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Yann E. MORIN @ 2025-02-16 17:03 UTC (permalink / raw)
  To: buildroot; +Cc: Yann E. MORIN, Ricardo Martincoski, Julien Olivain, Fiona Klute

Currently, our docker-run helper will decide on its own whether it
should use docker (preferred) or podman (fallback). s introduced in
9a629f5129d6 (utils/docker-run: allow running with Podman). In case
both are installed, it is not possible to exercise the podman case.

Allow the user to force the one to use, by setting the BR2_DOCKER
environment variable. If that is set and does not exist, exit with
an explicit error message (rather than rely on the failure when
eventually exec-ing the specified command).

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Ricardo Martincoski <ricardo.martincoski@datacom.com.br>
Cc: Julien Olivain <ju.o@free.fr>
Cc: Fiona Klute <fiona.klute@gmx.de>
---
 utils/docker-run | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/utils/docker-run b/utils/docker-run
index 849df66d54..27c169db72 100755
--- a/utils/docker-run
+++ b/utils/docker-run
@@ -35,7 +35,14 @@ declare -a mountpoints=(
 # compatibility command.
 export PODMAN_USERNS="keep-id"
 
-if command -v docker >/dev/null; then
+if [ "${BR2_DOCKER}" ]; then
+    if command -v "${BR2_DOCKER}" >/dev/null; then
+        DOCKER="${BR2_DOCKER}"
+    else
+        printf 'ERROR: Command "%s" (from env BR2_DOCKER) not found.\n' "${BR2_DOCKER}" >&2
+        exit 1
+    fi
+elif command -v docker >/dev/null; then
     DOCKER="docker"
 elif command -v podman >/dev/null; then
     DOCKER="podman"
-- 
2.47.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-02-18 20:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-16 17:03 [Buildroot] [PATCH] utils/docker-run: allow explicitly setting of docker/podman/ Yann E. MORIN
2025-02-17 12:13 ` Fiona Klute via buildroot
2025-02-17 20:54 ` Arnout Vandecappelle via buildroot
2025-02-17 21:53   ` Yann E. MORIN
2025-02-17 22:05     ` Arnout Vandecappelle via buildroot
2025-02-18  8:00       ` Yann E. MORIN
2025-02-18 20:23 ` Arnout Vandecappelle via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.