Files
Bo-Yi Wu a5469c939e 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>
2025-12-01 16:32:52 +08:00

27 lines
701 B
Docker

FROM alpine:3.22
ARG TARGETOS
ARG TARGETARCH
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
org.label-schema.name="Drone Jenkins Plugin" \
org.label-schema.vendor="Bo-Yi Wu" \
org.label-schema.schema-version="1.0"
LABEL org.opencontainers.image.source=https://github.com/appleboy/drone-jenkins
LABEL org.opencontainers.image.description="Drone Jenkins"
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"]