Skip to content

Commit 7df424c

Browse files
committed
chore: update Dockerfile and add .hadolint.yaml
- Add a new file `.hadolint.yaml` - Ignore the `DL3018` and `DL3008` rules in `.hadolint.yaml` - Update the base image in `docker/Dockerfile` from `alpine:3.17` to `alpine:3.19` - Remove the labels `org.label-schema.name`, `org.label-schema.vendor`, and `org.label-schema.schema-version` in `docker/Dockerfile` - Update the package installation command in `docker/Dockerfile` to remove the specific version of `ca-certificates` - Add a new user and group `deploy` with UID and GID `1000` in `docker/Dockerfile` - Create a directory `/home/deploy` and change its ownership to `deploy:deploy` in `docker/Dockerfile` - Set the user and group to `deploy:deploy` with UID and GID `1000` in `docker/Dockerfile` - Copy the `drone-scp` binary to `/bin/` in `docker/Dockerfile` Signed-off-by: appleboy <appleboy.tw@gmail.com>
1 parent e5bd02f commit 7df424c

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

.hadolint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ignored:
2+
- DL3018
3+
- DL3008

docker/Dockerfile

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1-
FROM alpine:3.17
1+
FROM alpine:3.19
22

33
ARG TARGETOS
44
ARG TARGETARCH
55

6-
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>" \
7-
org.label-schema.name="SCP Plugin" \
8-
org.label-schema.vendor="Bo-Yi Wu" \
9-
org.label-schema.schema-version="1.0"
6+
LABEL maintainer="Bo-Yi Wu <appleboy.tw@gmail.com>"
107

118
LABEL org.opencontainers.image.source=https://github.com/appleboy/drone-scp
129
LABEL org.opencontainers.image.description="Copy files and artifacts via SSH"
1310
LABEL org.opencontainers.image.licenses=MIT
1411

15-
RUN apk add --no-cache ca-certificates=20220614-r4 && \
12+
RUN apk add --no-cache ca-certificates && \
1613
rm -rf /var/cache/apk/*
1714

15+
RUN addgroup \
16+
-S -g 1000 \
17+
deploy && \
18+
adduser \
19+
-S -H -D \
20+
-h /home/deploy \
21+
-s /bin/sh \
22+
-u 1000 \
23+
-G deploy \
24+
deploy
25+
26+
RUN mkdir -p /home/deploy
27+
RUN chown deploy:deploy /home/deploy
28+
29+
# deploy:deploy
30+
USER 1000:1000
31+
1832
COPY release/${TARGETOS}/${TARGETARCH}/drone-scp /bin/
1933

2034
ENTRYPOINT ["/bin/drone-scp"]

0 commit comments

Comments
 (0)