Skip to content

Commit 7b74eb9

Browse files
authored
Run as nobody (#33)
1 parent 1faf40b commit 7b74eb9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
FROM golang:1.25-alpine as app-builder
22
WORKDIR /go/src/app
33

4+
RUN echo "nobody:x:65534:65534:nobody:/nonexistent:/usr/sbin/nologin" > /etc/passwd.nobody
5+
46
COPY src .
57

68
RUN CGO_ENABLED=0 go install -ldflags '-extldflags "-static"' -tags timetzdata
@@ -10,7 +12,10 @@ FROM scratch
1012

1113
LABEL maintainer="git@sktan.com"
1214

15+
COPY --from=app-builder /etc/passwd.nobody /etc/passwd
1316
COPY --from=app-builder /go/bin/aws-codeartifact-proxy /aws-codeartifact-proxy
1417
COPY --from=app-builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
1518

19+
USER 65534
20+
1621
ENTRYPOINT ["/aws-codeartifact-proxy"]

0 commit comments

Comments
 (0)