[Buildroot] [PATCH 13/14] support/dockerfile: allow to install packages

Yann E. MORIN yann.morin.1998 at free.fr
Sat Feb 3 15:26:15 UTC 2018


Ricardo, All,

On 2018-01-21 22:44 -0200, Ricardo Martincoski spake thusly:
> Some tools in the Docker image can be useful to a single test only.
> Allow tests to install packages on the fly instead of adding everything
> to the base Docker image.

I think I would prefer that our base image has all the tools we need.

Regards,
Yann E. MORIN.

> Signed-off-by: Ricardo Martincoski <ricardo.martincoski at gmail.com>
> Cc: Arnout Vandecappelle <arnout at mind.be>
> Cc: Peter Korsgaard <peter at korsgaard.com>
> Cc: Thomas Petazzoni <thomas.petazzoni at free-electrons.com>
> Cc: Yann E. MORIN <yann.morin.1998 at free.fr>
> ---
> For a demo, see the beginning of the log at this job:
> https://gitlab.com/RicardoMartincoski/buildroot/-/jobs/48876752
> ---
>  support/docker/Dockerfile | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/support/docker/Dockerfile b/support/docker/Dockerfile
> index ebb471f..9d115d8 100644
> --- a/support/docker/Dockerfile
> +++ b/support/docker/Dockerfile
> @@ -20,7 +20,8 @@ RUN apt-get install -y -qq --no-install-recommends \
>      cvs bzr git mercurial subversion wget \
>      cpio unzip \
>      libncurses5-dev \
> -    python-nose2 python-pexpect qemu-system-arm qemu-system-x86
> +    python-nose2 python-pexpect qemu-system-arm qemu-system-x86 \
> +    sudo
>  RUN apt-get -q -y autoremove
>  RUN apt-get -q -y clean
>  
> @@ -31,6 +32,11 @@ RUN /usr/sbin/locale-gen
>  RUN useradd -ms /bin/bash br-user
>  RUN chown -R br-user:br-user /home/br-user
>  
> +# Allow user to install packages
> +RUN adduser br-user sudo
> +RUN echo "br-user ALL = NOPASSWD : /usr/bin/apt-get" > /etc/sudoers.d/apt-get
> +RUN chmod 440 /etc/sudoers.d/apt-get
> +
>  USER br-user
>  WORKDIR /home/br-user
>  ENV HOME /home/br-user
> -- 
> 2.7.4
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'


More information about the buildroot mailing list