forked from kyma-project/kyma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (29 loc) · 1.04 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
FROM eu.gcr.io/kyma-project/test-infra/buildpack-golang-toolbox:v20190930-d28d219 as builder
ENV BASE_APP_DIR /go/src/github.com/kyma-project/kyma/components/console-backend-service
ENV GO111MODULE on
WORKDIR ${BASE_APP_DIR}
COPY ./go.mod ./go.sum ./
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
COPY . .
# Run tests
RUN make verify
# Build app
RUN make build
# Copy built app
RUN mkdir /app
RUN mv ./console-backend-service /app/main
COPY ./licenses/ /app/licenses
# Install certificates
FROM alpine:latest as certs
RUN apk --update add ca-certificates
FROM scratch
LABEL source = [email protected]:kyma-project/kyma.git
WORKDIR /app
# Copy binary
COPY --from=builder /app /app
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
# Run app
# -logtostderr=true is required, as glog is stupid and tries to log to /tmp, which crashes the pod
CMD ["/app/main", "-logtostderr=true"]