* [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* Re: [Buildroot] [PATCH] utils/docker-run: allow explicitly setting of docker/podman/... 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-18 20:23 ` Arnout Vandecappelle via buildroot 2 siblings, 0 replies; 7+ messages in thread From: Fiona Klute via buildroot @ 2025-02-17 12:13 UTC (permalink / raw) To: Yann E. MORIN, buildroot; +Cc: Ricardo Martincoski, Julien Olivain Am 16.02.25 um 18:03 schrieb Yann E. MORIN: > 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> Makes sense to me. Reviewed-by: Fiona Klute (WIWA) <fiona.klute@gmx.de> Best regards, Fiona > --- > 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" _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH] utils/docker-run: allow explicitly setting of docker/podman/... 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-18 20:23 ` Arnout Vandecappelle via buildroot 2 siblings, 1 reply; 7+ messages in thread From: Arnout Vandecappelle via buildroot @ 2025-02-17 20:54 UTC (permalink / raw) To: Yann E. MORIN, buildroot; +Cc: Ricardo Martincoski, Julien Olivain, Fiona Klute On 16/02/2025 18:03, Yann E. MORIN wrote: > 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. To be honest, if you have both installed, then you probably want to use podman because most likely "docker" is just an alias for podman... > 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). Unfortunately, in commit 8aad67f1575f1d8a9c90ccd70302e9a6823cf794, _someone_ already introduced the BR2_DOCKER environment variable in brmake to tell it to run 'make' inside the container... Its use is not incompatible, but it means that if you set BR2_DOCKER=podman in your .profile, brmake will _always_ run in the container... Regards, Arnout > 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" _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH] utils/docker-run: allow explicitly setting of docker/podman/... 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 0 siblings, 1 reply; 7+ messages in thread From: Yann E. MORIN @ 2025-02-17 21:53 UTC (permalink / raw) To: Arnout Vandecappelle Cc: buildroot, Ricardo Martincoski, Julien Olivain, Fiona Klute Arnout, All, On 2025-02-17 21:54 +0100, Arnout Vandecappelle spake thusly: > On 16/02/2025 18:03, Yann E. MORIN wrote: > > 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. > To be honest, if you have both installed, then you probably want to use > podman because most likely "docker" is just an alias for podman... That is probably a false assertion you are making above: podman impersonating docker is an additional package, at least in Fedora. And indeed, I have both podman and docker installed, and docker is definitely not podman. > > 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). > > Unfortunately, in commit 8aad67f1575f1d8a9c90ccd70302e9a6823cf794, > _someone_ already introduced the BR2_DOCKER environment variable in brmake > to tell it to run 'make' inside the container... Its use is not > incompatible, but it means that if you set BR2_DOCKER=podman in your > .profile, brmake will _always_ run in the container... Meh. Use of unbuffer was one of the stupidest things I did. Indeed, when using brmake, one is not very concerned about seeing logs as soon as they are emitted, so one can very well accept that the '>>>' messages be slightly delayed. After all, they are only bufferred for so much (8K in glibc, that goes by relatively fast with all the output of a clasical build...) I think it would have been much more elegant to actually allow use of "./utils/docker-run ./utils/brmake", as this is a construct that is already advertised to run our checks, "docker-run make check-package", or even just basically "./utils/docker-run make"... I would wager that "BR2_DOCKER=y ./utils/brmake" is not in wide use. Would that be acceptable to revert 8aad67f1575f1 and drop use of unbuffer? I've just checked, and that works (but of course, any still-bufferred output could get lost on Ctrl-C, but that's probably a non-issue while using brmake...) Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH] utils/docker-run: allow explicitly setting of docker/podman/... 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 0 siblings, 1 reply; 7+ messages in thread From: Arnout Vandecappelle via buildroot @ 2025-02-17 22:05 UTC (permalink / raw) To: Yann E. MORIN; +Cc: buildroot, Ricardo Martincoski, Julien Olivain, Fiona Klute On 17/02/2025 22:53, Yann E. MORIN wrote: > Arnout, All, > > On 2025-02-17 21:54 +0100, Arnout Vandecappelle spake thusly: >> On 16/02/2025 18:03, Yann E. MORIN wrote: >>> 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. >> To be honest, if you have both installed, then you probably want to use >> podman because most likely "docker" is just an alias for podman... > > That is probably a false assertion you are making above: podman > impersonating docker is an additional package, at least in Fedora. > And indeed, I have both podman and docker installed, and docker is > definitely not podman. Hm, perhaps I should do the same as you and install both... CI uses docker, I use podman, and sometimes they don't behave the same (because docker runs as root). In the beginning my muscle memory was still sometimes accidentally typing "docker ..." but now I do the right thing anyway. >>> 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). >> >> Unfortunately, in commit 8aad67f1575f1d8a9c90ccd70302e9a6823cf794, >> _someone_ already introduced the BR2_DOCKER environment variable in brmake >> to tell it to run 'make' inside the container... Its use is not >> incompatible, but it means that if you set BR2_DOCKER=podman in your >> .profile, brmake will _always_ run in the container... > > Meh. Use of unbuffer was one of the stupidest things I did. Indeed, when > using brmake, one is not very concerned about seeing logs as soon as > they are emitted, so one can very well accept that the '>>>' messages > be slightly delayed. After all, they are only bufferred for so much (8K > in glibc, that goes by relatively fast with all the output of a clasical > build...) > > I think it would have been much more elegant to actually allow use of > "./utils/docker-run ./utils/brmake", as this is a construct that is > already advertised to run our checks, "docker-run make check-package", > or even just basically "./utils/docker-run make"... > > I would wager that "BR2_DOCKER=y ./utils/brmake" is not in wide use. > Would that be acceptable to revert 8aad67f1575f1 and drop use of > unbuffer? I've just checked, and that works (but of course, any > still-bufferred output could get lost on Ctrl-C, but that's probably > a non-issue while using brmake...) Indeed, this feature was only introduced in 2024.11 (and very late in the cycle), and it wasn't documented other than in utils/readme.txt, so I think it's OK to drop it. Myself, I anyway always have to look up the exact wording of the environment variable, so I wouldn't miss it! Regards, Arnout _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH] utils/docker-run: allow explicitly setting of docker/podman/... 2025-02-17 22:05 ` Arnout Vandecappelle via buildroot @ 2025-02-18 8:00 ` Yann E. MORIN 0 siblings, 0 replies; 7+ messages in thread From: Yann E. MORIN @ 2025-02-18 8:00 UTC (permalink / raw) To: Arnout Vandecappelle Cc: buildroot, Ricardo Martincoski, Julien Olivain, Fiona Klute Arnout, All, On 2025-02-17 23:05 +0100, Arnout Vandecappelle spake thusly: > On 17/02/2025 22:53, Yann E. MORIN wrote: [--SNIP--] > > I would wager that "BR2_DOCKER=y ./utils/brmake" is not in wide use. > > Would that be acceptable to revert 8aad67f1575f1 and drop use of > > unbuffer? I've just checked, and that works (but of course, any > > still-bufferred output could get lost on Ctrl-C, but that's probably > > a non-issue while using brmake...) > Indeed, this feature was only introduced in 2024.11 (and very late in the > cycle), and it wasn't documented other than in utils/readme.txt, so I think > it's OK to drop it. Done, series sent, thanks. > Myself, I anyway always have to look up the exact wording of the > environment variable, so I wouldn't miss it! :-) Regards, Yann E. MORIN. -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Buildroot] [PATCH] utils/docker-run: allow explicitly setting of docker/podman/... 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-18 20:23 ` Arnout Vandecappelle via buildroot 2 siblings, 0 replies; 7+ messages in thread From: Arnout Vandecappelle via buildroot @ 2025-02-18 20:23 UTC (permalink / raw) To: Yann E. MORIN, buildroot; +Cc: Ricardo Martincoski, Julien Olivain, Fiona Klute On 16/02/2025 18:03, Yann E. MORIN wrote: > 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> Applied to master, thanks. Regards, Arnout > --- > 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" _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [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.