mirror of
https://github.com/appleboy/drone-jenkins.git
synced 2026-06-04 10:15:02 +08:00
refactor: run container as non-root dedicated drone user
- Add a dedicated drone user and group for running the container - Change file ownership of the drone-jenkins binary to the drone user - Switch container execution to use the drone user instead of root Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -15,6 +15,12 @@ LABEL org.opencontainers.image.licenses=MIT
|
||||
RUN apk add --no-cache ca-certificates && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
RUN addgroup -g 1000 drone && \
|
||||
adduser -D -u 1000 -G drone drone
|
||||
|
||||
COPY release/${TARGETOS}/${TARGETARCH}/drone-jenkins /bin/
|
||||
RUN chown drone:drone /bin/drone-jenkins
|
||||
|
||||
USER drone
|
||||
|
||||
ENTRYPOINT ["/bin/drone-jenkins"]
|
||||
|
||||
Reference in New Issue
Block a user