fixed nonroot
This commit is contained in:
parent
c520dfc3b5
commit
b8f835eb3a
3 changed files with 10 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
|||
FROM golang:alpine as builder
|
||||
RUN adduser -D -g '' appuser
|
||||
RUN adduser -D -g 65532 -u 65532 appuser
|
||||
RUN mkdir /build
|
||||
ADD . /build/
|
||||
WORKDIR /build
|
||||
|
|
@ -10,5 +10,5 @@ COPY --from=builder /etc/passwd /etc/passwd
|
|||
COPY --from=builder /etc/ssl/cert.pem /etc/ssl/cert.pem
|
||||
COPY --from=builder /build/main /main
|
||||
USER appuser
|
||||
EXPOSE 8080
|
||||
EXPOSE 8443
|
||||
ENTRYPOINT ["/main"]
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ spec:
|
|||
allowPrivilegeEscalation: false
|
||||
requiredDropCapabilities: ["ALL"]
|
||||
readOnlyRootFilesystem: true
|
||||
volumes: ["secret"]
|
||||
volumes: ["configMap", "secret"]
|
||||
hostNetwork: false
|
||||
hostIPC: false
|
||||
hostPID: false
|
||||
|
|
|
|||
|
|
@ -21,11 +21,17 @@ spec:
|
|||
- name: template-solver
|
||||
image: git.giftfish.de/ston1th/template-solver
|
||||
imagePullPolicy: Always
|
||||
securityContext:
|
||||
runAsUser: 65532
|
||||
runAsGroup: 65532
|
||||
capabilities:
|
||||
drop: ["ALL"]
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
args:
|
||||
- --secure-port=8443
|
||||
- --tls-cert-file=/tls/tls.crt
|
||||
- --tls-private-key-file=/tls/tls.key
|
||||
env:
|
||||
|
|
@ -33,7 +39,7 @@ spec:
|
|||
value: template-solver
|
||||
ports:
|
||||
- name: https
|
||||
containerPort: 443
|
||||
containerPort: 8443
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue