github.com/kyma-project/kyma/components/asset-store-controller-manager@v0.0.0-20191203152857-3792b5df17c5/Dockerfile (about)

     1  # Build the manager binary
     2  FROM golang:1.12.5 as builder
     3  
     4  WORKDIR /workspace
     5  # Copy the Go Modules manifests
     6  COPY go.mod go.mod
     7  COPY go.sum go.sum
     8  # cache deps before building and copying source so that we don't need to re-download as much
     9  # and so that source changes don't invalidate our downloaded layer
    10  RUN go mod download
    11  
    12  # Copy the go source
    13  COPY main.go main.go
    14  COPY pkg/ pkg/
    15  COPY internal/ internal/
    16  COPY licenses/ licenses/
    17  
    18  # Build
    19  RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
    20  
    21  # Get latest CA certs
    22  FROM alpine:latest as certs
    23  RUN apk --update add ca-certificates
    24  
    25  # Use distroless as minimal base image to package the manager binary
    26  # Refer to https://github.com/GoogleContainerTools/distroless for more details
    27  FROM scratch
    28  LABEL source = git@github.com:kyma-project/kyma.git
    29  WORKDIR /
    30  COPY --from=builder /workspace/manager .
    31  COPY --from=builder /workspace/licenses licenses/
    32  COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
    33  ENTRYPOINT ["/manager"]