utils/docker-run: allow IMAGE to be passed in the environment
PATCH 1/1 utils/docker-run: allow IMAGE to be passed in the environment
It is sometimes useful to use docker-run, but with a different image than the default one. This commit allows to override the image being used by only defining IMAGE if not already passed in the environment.
---
Note: this patch applies on top of the series of patches on utils/docker-run by Yann E. Morin at
https://patchwork.ozlabs.org/project/buildroot/list/?series=368134.
--- utils/docker-run | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
utils/docker-run +5 -3
@@ -9,9 +9,11 @@ else # Support git-worktree GIT_DIR="$(cd "${MAIN_DIR}" && git rev-parse --no-flags --git-common-dir)" fi -# shellcheck disable=SC2016 -IMAGE=$(grep ^image: "${MAIN_DIR}/.gitlab-ci.yml" | \ - sed -e 's,^image: ,,g' | sed -e 's,\$CI_REGISTRY,registry.gitlab.com,g') +if test -z "${IMAGE}" ; then + # shellcheck disable=SC2016 + IMAGE=$(grep ^image: "${MAIN_DIR}/.gitlab-ci.yml" | \ + sed -e 's,^image: ,,g' | sed -e 's,\$CI_REGISTRY,registry.gitlab.com,g') +fi declare -a docker_opts=( -i
Signature · 6 lines
2.41.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Yann E. MORIN
AppliedThomas, All,
On 2023-08-20 15:33 +0200, Thomas Petazzoni via buildroot spake thusly:
Quoted 18 lines
It is sometimes useful to use docker-run, but with a different image than the default one. This commit allows to override the image being used by only defining IMAGE if not already passed in the environment.
Signed-off-by Thomas Petazzoni <[email protected]>---
Note: this patch applies on top of the series of patches on utils/docker-run by Yann E. Morin at
https://patchwork.ozlabs.org/project/buildroot/list/?series=368134.--- utils/docker-run | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)utils/docker-run +0
-0
utils/docker-run else · line 15
Quoted 10 lines
utils/docker-run +4
-3@@ -9,9 +9,11 @@ else # Support git-worktree GIT_DIR="$(cd "${MAIN_DIR}" && git rev-parse --no-flags --git-common-dir)" fi -# shellcheck disable=SC2016 -IMAGE=$(grep ^image: "${MAIN_DIR}/.gitlab-ci.yml" | \ - sed -e 's,^image: ,,g' | sed -e 's,\$CI_REGISTRY,registry.gitlab.com,g') +if test -z "${IMAGE}" ; then + # shellcheck disable=SC2016 + IMAGE=$(grep ^image: "${MAIN_DIR}/.gitlab-ci.yml" | \ + sed -e 's,^image: ,,g' | sed -e 's,\$CI_REGISTRY,registry.gitlab.com,g')
s/\t+/ /g
Applied to next, thanks.
Regards,
Yann E. MORIN.
Quoted 11 lines
utils/docker-run +1
-0+fi declare -a docker_opts=( -iSignature · 6 lines
2.41.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | 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 [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot