mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-28 10:28:36 +00:00
fix: docker build (#3907)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com>
This commit is contained in:
parent
a5e623f939
commit
526876452e
1 changed files with 7 additions and 5 deletions
|
@ -1,5 +1,9 @@
|
|||
# Multi-stage docker build
|
||||
# Build stage
|
||||
FROM golang:alpine AS certs
|
||||
|
||||
LABEL maintainer="Kyverno"
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
FROM golang@sha256:724abf4dd44985d060f7aa91af5211eb2052491424bd497ba3ddc31f7cee969d AS builder
|
||||
|
||||
LABEL maintainer="Kyverno"
|
||||
|
@ -16,8 +20,6 @@ RUN export GOOS=$(echo ${TARGETPLATFORM} | cut -d / -f1) && \
|
|||
|
||||
RUN go env
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
RUN CGO_ENABLED=0 go build -o /output/kyverno -ldflags="${LD_FLAGS}" -v ./cmd/kyverno/
|
||||
|
||||
# Packaging stage
|
||||
|
@ -26,7 +28,7 @@ FROM scratch
|
|||
LABEL maintainer="Kyverno"
|
||||
COPY --from=builder /output/kyverno /
|
||||
COPY --from=builder /etc/passwd /etc/passwd
|
||||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||
|
||||
USER 10001
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue