Skip to content

Commit 3c8acb2

Browse files
author
Daniel Lemire
committed
fixes permissions for the docker approach
1 parent 07b623c commit 3c8acb2

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

Dockerfile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1. Check out LLVM source code and run the build.
2-
FROM debian:12 as builder
2+
FROM debian:12 AS builder
33
# First, Update the apt's source list and include the sources of the packages.
44
RUN grep deb /etc/apt/sources.list | \
55
sed 's/^deb/deb-src /g' >> /etc/apt/sources.list
@@ -21,6 +21,9 @@ RUN cmake --install /tmp/clang-source/build-llvm --prefix /tmp/clang-install
2121

2222
# Stage 2. Produce a minimal release image with build results.
2323
FROM debian:12
24+
ARG USER_NAME
25+
ARG USER_ID
26+
ARG GROUP_ID
2427
LABEL maintainer "LLVM Developers"
2528
# Install packages for minimal useful image.
2629
RUN apt-get update && \
@@ -30,3 +33,10 @@ RUN apt-get update && \
3033
COPY --from=builder /tmp/clang-install/ /usr/local/
3134
RUN P=`/usr/local/bin/clang++ -v 2>&1 | grep Target | cut -d' ' -f2-`; echo /usr/local/lib/$P > /etc/ld.so.conf.d/$P.conf
3235
RUN ldconfig
36+
RUN addgroup --gid $GROUP_ID user; exit 0
37+
RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID $USER_NAME; exit 0
38+
RUN echo "$USER_NAME:$USER_NAME" | chpasswd && adduser $USER_NAME sudo
39+
RUN echo '----->'
40+
RUN echo 'root:Docker!' | chpasswd
41+
ENV TERM xterm-256color
42+
USER $USER_NAME

0 commit comments

Comments
 (0)