-
Notifications
You must be signed in to change notification settings - Fork 22
/
Dockerfile.keb
35 lines (26 loc) · 977 Bytes
/
Dockerfile.keb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Build image
FROM golang:1.23.2-alpine3.20 AS build
WORKDIR /go/src/github.com/kyma-project/kyma-environment-broker
COPY cmd cmd
COPY common common
COPY internal internal
COPY go.mod go.mod
COPY go.sum go.sum
RUN mkdir /user && \
echo 'appuser:x:2000:2000:appuser:/:' > /user/passwd && \
echo 'appuser:x:2000:' > /user/group
RUN CGO_ENABLED=0 go build -o /bin/kyma-env-broker ./cmd/broker/
RUN touch /swagger.yaml
# Get latest CA certs
FROM alpine:3.20.3 as certs
RUN apk --update add ca-certificates
# Final image
FROM scratch
LABEL source=git@github.com:kyma-project/kyma-environment-broker.git
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /bin/kyma-env-broker /bin/kyma-env-broker
COPY --from=build /user/group /user/passwd /etc/
USER appuser:appuser
COPY --chown=appuser /files/swagger /swagger
COPY --from=build --chown=appuser /swagger.yaml /swagger/swagger.yaml
CMD ["/bin/kyma-env-broker"]