Matching user ID to container agent UID

This commit is contained in:
vandomej 2025-09-19 11:46:34 -07:00
parent 28c71177df
commit fe0d32065a

View file

@ -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"]