-
Notifications
You must be signed in to change notification settings - Fork 408
/
Dockerfile
31 lines (19 loc) · 851 Bytes
/
Dockerfile
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
FROM golang:1.21.5-alpine3.18 as builder
ARG DOCK_PKG_DIR=/go/src/github.com/kyma-project/kyma/components/central-application-gateway
WORKDIR $DOCK_PKG_DIR
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . $DOCK_PKG_DIR
RUN echo "nobody:x:65534:5534:nobody:/:" > /etc_passwd
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o applicationgateway ./cmd/applicationgateway
FROM eu.gcr.io/kyma-project/external/alpine:3.17.3 as certs
RUN apk add -U --no-cache ca-certificates
FROM scratch
LABEL source=git@github.com:kyma-project/kyma.git
WORKDIR /app
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/src/github.com/kyma-project/kyma/components/central-application-gateway/applicationgateway .
COPY --from=builder /etc_passwd /etc/passwd
USER nobody
CMD ["/app/applicationgateway"]