Merge "[OOM-CERT-SERVICE] Add change-log"
[oom/platform/cert-service.git] / certServiceK8sExternalProvider / Dockerfile
1 # ============LICENSE_START=======================================================
2 # oom-certservice-k8s-external-provider
3 # ================================================================================
4 # Copyright (c) 2019 Smallstep Labs, Inc.
5 # Modifications copyright (C) 2020 Nokia. All rights reserved.
6 # ================================================================================
7 # This source code was copied from the following git repository:
8 # https://github.com/smallstep/step-issuer
9 # The source code was modified for usage in the ONAP project.
10 # ================================================================================
11 # Licensed under the Apache License, Version 2.0 (the "License");
12 # you may not use this file except in compliance with the License.
13 # You may obtain a copy of the License at
14 #
15 #      http://www.apache.org/licenses/LICENSE-2.0
16 #
17 # Unless required by applicable law or agreed to in writing, software
18 # distributed under the License is distributed on an "AS IS" BASIS,
19 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 # See the License for the specific language governing permissions and
21 # limitations under the License.
22 # ============LICENSE_END=========================================================
23 #
24
25 # Build the manager binary
26 FROM golang:1.15.2 as builder
27
28 WORKDIR /workspace
29 # Copy the Go Modules manifests
30 COPY go.* ./
31
32 # cache deps before building and copying source so that we don't need to re-download as much
33 # and so that source changes don't invalidate our downloaded layer
34 RUN go mod download
35
36 # Copy the go source
37 COPY main.go main.go
38 COPY src/ ./src
39
40 # Build
41 RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o oom-certservice-cmpv2issuer main.go
42
43
44 # Runtime container definition
45 FROM gcr.io/distroless/static:latest
46 WORKDIR /
47 COPY --from=builder /workspace/oom-certservice-cmpv2issuer .
48 ENTRYPOINT ["/oom-certservice-cmpv2issuer"]