File tree Expand file tree Collapse file tree 5 files changed +33
-7
lines changed
Expand file tree Collapse file tree 5 files changed +33
-7
lines changed Original file line number Diff line number Diff line change 11FROM golang:1.14.4-alpine3.12 as build
22
3- RUN apk -U add git make
3+ RUN apk -U add --no-cache git make ca-certificates && update-ca-certificates
44
5- WORKDIR /venona
5+ ENV USER=venona
6+ ENV UID=10001
7+
8+ RUN adduser \
9+ --disabled-password \
10+ --gecos "" \
11+ --home "/nonexistent" \
12+ --shell "/sbin/nologin" \
13+ --no-create-home \
14+ --uid "${UID}" \
15+ "${USER}"
616
7- COPY go.mod .
8- RUN go mod download
17+ WORKDIR /venona
918
1019COPY . .
20+ RUN go mod download -x
21+ RUN go mod verify
1122
23+ # compile
1224RUN make build
1325
1426FROM alpine:3.12
1527
16- RUN apk update && apk add --no-cache ca-certificates && apk upgrade
28+ # copy ca-certs and user details
29+ COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
30+ COPY --from=build /etc/passwd /etc/passwd
31+ COPY --from=build /etc/group /etc/group
1732
33+ # copy binary
1834COPY --from=build /venona/venona /usr/local/bin/venona
1935
36+ USER venona:venona
37+
2038ENTRYPOINT [ "venona" ]
2139
2240CMD [ "start" ]
Original file line number Diff line number Diff line change 1- 1.5.18
1+ 1.6.0
Original file line number Diff line number Diff line change 1- 1.5.18
1+ 1.6.0
Original file line number Diff line number Diff line change 8888 name : {{ .AppName }}
8989 resources :
9090{{ toYaml .Runner.Resources | indent 10 }}
91+ securityContext :
92+ runAsUser : 10001
93+ runAsGroup : 10001
94+ fsGroup : 10001
9195 restartPolicy : Always
You can’t perform that action at this time.
0 commit comments