Matching user ID to container agent UID
This commit is contained in:
parent
28c71177df
commit
fe0d32065a
1 changed files with 7 additions and 7 deletions
|
|
@ -1,15 +1,15 @@
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
# Install all necessary tools: git, build tools
|
# Install necessary tools
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache git build-base
|
||||||
git \
|
|
||||||
build-base
|
|
||||||
|
|
||||||
# Create a non-root user to run the build
|
# Create builder user with arguments for UID/GID
|
||||||
RUN adduser -D builder
|
ARG UID=1000
|
||||||
|
ARG GID=1000
|
||||||
|
RUN addgroup -g $GID builder && \
|
||||||
|
adduser -D -u $UID -G builder builder
|
||||||
USER builder
|
USER builder
|
||||||
WORKDIR /home/builder
|
WORKDIR /home/builder
|
||||||
|
|
||||||
# The default command will be the build script
|
|
||||||
COPY build.sh .
|
COPY build.sh .
|
||||||
CMD ["/bin/sh", "build.sh"]
|
CMD ["/bin/sh", "build.sh"]
|
||||||
Loading…
Add table
Reference in a new issue