From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>,
Christian Stewart <christian@paral.in>,
Buildroot List <buildroot@buildroot.org>
Cc: Ricardo Martincoski <ricardo.martincoski@datacom.com.br>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH RFC 2/2] utils/docker-run: mount the download directory if specified
Date: Wed, 26 Jul 2023 23:20:08 +0200 [thread overview]
Message-ID: <20230726212009.221147-2-thomas.petazzoni@bootlin.com> (raw)
In-Reply-To: <20230726212009.221147-1-thomas.petazzoni@bootlin.com>
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 <thomas.petazzoni@bootlin.com>
---
Here as well, opinion from Docker expert would be useful. For example,
with this change, the files added in the download directory are owned
by $USER:docker and not $USER:$USER as would probably be expected.
---
utils/docker-run | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/utils/docker-run b/utils/docker-run
index eee1aad7a4..6ea4311c68 100755
--- a/utils/docker-run
+++ b/utils/docker-run
@@ -20,4 +20,8 @@ if tty -s; then
docker_opts+=( -t )
fi
+if test -n "${BR2_DL_DIR}"; then
+ docker_opts+=( --volume "${BR2_DL_DIR}:/dl:Z" -e "BR2_DL_DIR=/dl" )
+fi
+
exec docker run "${docker_opts[@]}" "${IMAGE}" "${@}"
--
2.41.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-07-26 21:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-26 21:20 [Buildroot] [PATCH RFC 1/2] utils/docker-run: make it compatible with SELinux Thomas Petazzoni via buildroot
2023-07-26 21:20 ` Thomas Petazzoni via buildroot [this message]
2023-08-08 20:50 ` [Buildroot] [PATCH RFC 2/2] utils/docker-run: mount the download directory if specified Yann E. MORIN
2023-08-08 21:24 ` Thomas Petazzoni via buildroot
2023-07-27 8:13 ` [Buildroot] [PATCH RFC 1/2] utils/docker-run: make it compatible with SELinux Antoine Tenart
2023-07-27 8:48 ` Thomas Petazzoni via buildroot
2023-07-27 10:19 ` Antoine Tenart
2023-07-27 10:24 ` Thomas Petazzoni via buildroot
2023-07-27 10:50 ` Antoine Tenart
2023-07-27 11:47 ` Antoine Tenart
2023-07-27 16:21 ` Yann E. MORIN
[not found] ` <CA+h8R2qJF87Wi_w9DBjFZO__x=Kku+hfU1_-uhn2tLegFtc37g@mail.gmail.com>
2023-07-28 7:24 ` Thomas Petazzoni via buildroot
2023-08-09 21:32 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230726212009.221147-2-thomas.petazzoni@bootlin.com \
--to=buildroot@buildroot.org \
--cc=christian@paral.in \
--cc=ricardo.martincoski@datacom.com.br \
--cc=thomas.petazzoni@bootlin.com \
--cc=yann.morin.1998@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox