File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 11# Build the manager binary
22ARG BASE_IMAGE=alpine
33ARG BASE_IMAGE_VERION=3.17
4- FROM --platform=$BUILDPLATFORM golang:1.18 -alpine3.17 as builder
4+ FROM --platform=$BUILDPLATFORM golang:1.19 -alpine3.17 as builder
55
66WORKDIR /workspace
77
@@ -23,12 +23,25 @@ ARG BASE_IMAGE
2323ARG BASE_IMAGE_VERION
2424FROM ${BASE_IMAGE}:${BASE_IMAGE_VERION}
2525
26- RUN apk add --no-cache ca-certificates=~20220614-r4 bash=~5.2.15-r0 expat=~2.5.0-r0 \
27- && rm -rf /var/cache/apk/*
26+ RUN set -eux; \
27+ apk --no-cache --update upgrade && \
28+ apk --no-cache add ca-certificates && \
29+ apk --no-cache add tzdata && \
30+ rm -rf /var/cache/apk/* && \
31+ update-ca-certificates && \
32+ echo "only include root and nobody user" && \
33+ echo -e "root:x:0:0:root:/root:/bin/ash\nnobody:x:65534:65534:nobody:/:/sbin/nologin" | tee /etc/passwd && \
34+ echo -e "root:x:0:root\nnobody:x:65534:" | tee /etc/group && \
35+ rm -rf /usr/local/sbin/* && \
36+ rm -rf /usr/local/bin/* && \
37+ rm -rf /usr/sbin/* && \
38+ rm -rf /usr/bin/* && \
39+ rm -rf /sbin/* && \
40+ rm -rf /bin/*
2841
2942WORKDIR /
3043COPY --from=builder /workspace/manager .
3144COPY lua_configuration /lua_configuration
32- USER 1000
45+ USER 65534
3346
3447ENTRYPOINT ["/manager"]
You can’t perform that action at this time.
0 commit comments