Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] support/dockerfile: add directives to run as non-root
@ 2018-01-06 15:28 Yann E. MORIN
  2018-01-12 21:54 ` Thomas Petazzoni
  2018-02-03 21:47 ` Peter Korsgaard
  0 siblings, 2 replies; 12+ messages in thread
From: Yann E. MORIN @ 2018-01-06 15:28 UTC (permalink / raw)
  To: buildroot

Currently, our jobs on the gitlab-ci infra are running as root, which is
problematic for two reasons:

  - this is not the usual way Buildroot is built;
  - it may miss issues where running as non-root is problematic.

So, complement our Dockerfile with directives to add a new user and run
everything as that user, as demonstrated by this build job:
    https://gitlab.com/ymorin/buildroot-ci/-/jobs/46929562

Additional, enforce an UTF-8 locale while running.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Peter Korsgaard <peter@korsgaard.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 support/docker/Dockerfile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/support/docker/Dockerfile b/support/docker/Dockerfile
index d45b23dc23..ebb471f7e5 100644
--- a/support/docker/Dockerfile
+++ b/support/docker/Dockerfile
@@ -28,3 +28,10 @@ RUN apt-get -q -y clean
 RUN sed -i 's/# \(en_US.UTF-8\)/\1/' /etc/locale.gen
 RUN /usr/sbin/locale-gen
 
+RUN useradd -ms /bin/bash br-user
+RUN chown -R br-user:br-user /home/br-user
+
+USER br-user
+WORKDIR /home/br-user
+ENV HOME /home/br-user
+ENV LC_ALL en_US.UTF-8
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-02-05 10:56 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-06 15:28 [Buildroot] [PATCH] support/dockerfile: add directives to run as non-root Yann E. MORIN
2018-01-12 21:54 ` Thomas Petazzoni
2018-01-13 11:28   ` Yann E. MORIN
2018-01-14 13:02     ` Thomas Petazzoni
2018-01-14 21:32       ` Arnout Vandecappelle
2018-02-03 21:47 ` Peter Korsgaard
2018-02-04 10:04   ` Yann E. MORIN
2018-02-04 14:46     ` Yann E. MORIN
2018-02-05  3:52     ` Cam Hutchison
2018-02-05  7:18       ` Yann E. MORIN
2018-02-05  9:51         ` Cam Hutchison
2018-02-05 10:56         ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox