Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Christian Stewart <christian@paral.in>,
	Ricardo Martincoski <ricardo.martincoski@datacom.com.br>,
	Buildroot List <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH RFC 2/2] utils/docker-run: mount the download directory if specified
Date: Tue, 8 Aug 2023 22:50:47 +0200	[thread overview]
Message-ID: <20230808205047.GC421096@scaer> (raw)
In-Reply-To: <20230726212009.221147-2-thomas.petazzoni@bootlin.com>

Thomas, All,

On 2023-07-26 23:20 +0200, Thomas Petazzoni via buildroot spake thusly:
> 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.

Here, with --mount, they do belong to $USER:$USER...

So, I guess your issue is that /dl does not exist in the container, so
it is created by the docker runtime and thus group-belongs to docker,
and the SELinux labelling means that everything beneath it also belongs
to docker.

Also:

* what about files that already existed before: are the chgrp-ed to
  docker, or do they retain their group?

* and from within the container, whom do the files belong to?

Regards,
Yann E. MORIN.

> ---
>  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

-- 
.-----------------.--------------------.------------------.--------------------.
|  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

  reply	other threads:[~2023-08-08 20:51 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 ` [Buildroot] [PATCH RFC 2/2] utils/docker-run: mount the download directory if specified Thomas Petazzoni via buildroot
2023-08-08 20:50   ` Yann E. MORIN [this message]
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=20230808205047.GC421096@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=christian@paral.in \
    --cc=ricardo.martincoski@datacom.com.br \
    --cc=thomas.petazzoni@bootlin.com \
    /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