From 7fddbe25301aae024f7fc22498392387f6874506 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Wed, 9 Aug 2023 23:24:47 +0200 Subject: [PATCH] utils/docker-run: mount the download directory if specified If the user has defined $BR2_DL_DIR in the environment, it would be nice to have it accessible inside the Docker container, and the BR2_DL_DIR environment variable set to access it. This commit does exactly this: it mounts the host $BR2_DL_DIR as /dl in the container, and sets BR2_DL_DIR=/dl in the container. Signed-off-by: Thomas Petazzoni [yann.morin.1998@free.fr: use the new mountpoints list] Signed-off-by: Yann E. MORIN --- utils/docker-run | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/docker-run b/utils/docker-run index 2f689a1fbd..7b27a9b05c 100755 --- a/utils/docker-run +++ b/utils/docker-run @@ -35,6 +35,11 @@ if [ "${GIT_DIR}" ]; then mountpoints+=( "${GIT_DIR}" ) fi +if [ "${BR2_DL_DIR}" ]; then + mountpoints+=( "${BR2_DL_DIR}" ) + docker_opts+=( --env BR2_DL_DIR ) +fi + # shellcheck disable=SC2013 # can't use while-read because of the assignment for dir in $(printf '%s\n' "${mountpoints[@]}" |LC_ALL=C sort -u); do docker_opts+=( --mount "type=bind,src=${dir},dst=${dir}" )