diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..502b578 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,3 @@ +ignored: + - DL3018 + - DL3008 diff --git a/docker/Dockerfile b/docker/Dockerfile index fd4040e..ea129ce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,9 +12,26 @@ LABEL org.opencontainers.image.source=https://github.com/appleboy/drone-ssh LABEL org.opencontainers.image.description="Execute commands on a remote host through SSH" LABEL org.opencontainers.image.licenses=MIT -RUN apk add --no-cache ca-certificates=20230506-r0 && \ +RUN apk add --no-cache ca-certificates && \ rm -rf /var/cache/apk/* +RUN addgroup \ + -S -g 1000 \ + deploy && \ + adduser \ + -S -H -D \ + -h /home/deploy \ + -s /bin/sh \ + -u 1000 \ + -G deploy \ + deploy + +RUN mkdir -p /home/deploy && \ + chown deploy:deploy /home/deploy + +# deploy:deploy +USER 1000:1000 + COPY release/${TARGETOS}/${TARGETARCH}/drone-ssh /bin/ ENTRYPOINT ["/bin/drone-ssh"]