All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH next 1/1] utils/docker-run: check for podman before docker
@ 2024-05-31 19:51 Julien Olivain
  2024-05-31 20:09 ` Yann E. MORIN
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Olivain @ 2024-05-31 19:51 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Olivain, Ricardo Martincoski

Commit 9a629f5 "utils/docker-run: allow running with Podman" added an
option on system providing the podman command. This case is mainly
for Fedora systems.

Fedora repositories has a podman-docker package, that provide the
docker command for compatibility. See [1].

When this package is installed on a Fedora system, both the docker and
podman commands are available. Since the docker command is checked
before podman, the --userns option is not passed in that case. This
brings "permission denied" errors.

This commit inverses the command check order, to check for podman
before docker. This makes sure this mechanisms will work when both
commands.

Note that the same behavior of the --userns=keepid option can be
achieved by setting the environment variable "PODMAN_USERNS=keep-id".
See podman-run man page [2].

[1] https://packages.fedoraproject.org/pkgs/podman/podman-docker/
[2] https://docs.podman.io/en/latest/markdown/podman-run.1.html

Signed-off-by: Julien Olivain <ju.o@free.fr>
---
 utils/docker-run | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/utils/docker-run b/utils/docker-run
index 3dcabe2718b..51390945119 100755
--- a/utils/docker-run
+++ b/utils/docker-run
@@ -29,11 +29,11 @@ declare -a mountpoints=(
     "$(pwd)"
 )
 
-if command -v docker >/dev/null; then
-    DOCKER="docker"
-elif command -v podman >/dev/null; then
+if command -v podman >/dev/null; then
     DOCKER="podman"
     docker_opts+=( --userns=keep-id )
+elif command -v docker >/dev/null; then
+    DOCKER="docker"
 else
     echo "ERROR: Neither docker nor podman available!" >&2
     exit 1
-- 
2.45.1

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

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

end of thread, other threads:[~2024-06-01  9:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-31 19:51 [Buildroot] [PATCH next 1/1] utils/docker-run: check for podman before docker Julien Olivain
2024-05-31 20:09 ` Yann E. MORIN
2024-06-01  9:45   ` Julien Olivain

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.