File tree 1 file changed +12
-12
lines changed
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
- FROM ubuntu:20.04
1
+ FROM golang:1.21-alpine AS builder
2
2
3
- RUN apt-get update && \
4
- apt-get install --no-install-recommends -y ca-certificates=20240203~20.04.1 && \
5
- mkdir -p /etc/kangal && \
6
- apt-get clean && \
7
- rm -rf /var/lib/apt/lists/*
3
+ RUN apk --no-cache add ca-certificates=20241121-r1 && \
4
+ update-ca-certificates
8
5
9
- COPY kangal /bin/kangal
10
- COPY openapi.json /etc/kangal/
6
+ FROM scratch
7
+ USER nobody
8
+ # Use nobody user + group
9
+ USER nobody:nobody
10
+ # Copy nobody user
11
+ COPY --from=builder /etc/passwd /etc/passwd
12
+ COPY --from=builder /etc/group /etc/group
11
13
12
- RUN chmod a+x /bin/kangal && \
13
- chmod -R a+r /etc/kangal
14
+ COPY kangal /bin/kangal
14
15
15
- # Use nobody user + group
16
- USER 65534:65534
16
+ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
17
17
18
18
EXPOSE 8080
19
19
ENTRYPOINT ["/bin/kangal" ]
You can’t perform that action at this time.
0 commit comments