[U-Boot] [gitlab-ci-runner][PATCH 1/2] Dockerfile: Switch to non-root user

Tom Rini trini at konsulko.com
Fri Oct 4 15:32:34 UTC 2019


Add a 'uboot' user / group, allow them sudo access and make use of them
in the container.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 Dockerfile | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index 1d7a3dae39d0..c7b35026a171 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -136,6 +136,11 @@ RUN git clone git://git.qemu.org/qemu.git /tmp/qemu && \
 	make -j$(nproc) all install && \
 	rm -rf /tmp/qemu
 
+# Create our user/group
+RUN echo uboot ALL=NOPASSWD: ALL > /etc/sudoers.d/uboot
+RUN useradd -m -U uboot
+USER uboot:uboot
+
 # Create the buildman config file
 RUN /bin/echo -e "[toolchain]\nroot = /usr" > ~/.buildman
 RUN /bin/echo -e "kernelorg = /opt/gcc-7.3.0-nolibc/*" >> ~/.buildman
-- 
2.17.1



More information about the U-Boot mailing list