blob: 71044985adf0d8190dc304224c543718c4d2338c [file] [log] [blame]
Kent Hagermanda41d742020-01-07 14:55:56 -05001# Copyright 2020-present Open Networking Foundation
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Zack Williams88200d32020-04-02 13:36:41 -070015FROM golang:1.13.9-alpine as build
Kent Hagermanda41d742020-01-07 14:55:56 -050016
17RUN apk add --no-cache build-base=0.5-r1
18
19# download & compile this specific version of go-junit-report
20ARG GO_JUNIT_REPORT_VERSION
21RUN GO111MODULE=on CGO_ENABLED=0 go get -u -ldflags "-linkmode external -extldflags -static" github.com/jstemmer/go-junit-report@v$GO_JUNIT_REPORT_VERSION
22
23FROM busybox:1.31.1
24
25# copy go-junit-report
26COPY --from=build /go/bin/* /usr/local/bin/
27
28WORKDIR /app
29
30# Label image
31ARG org_label_schema_version=unknown
32ARG org_label_schema_vcs_url=unknown
33ARG org_label_schema_vcs_ref=unknown
34ARG org_label_schema_build_date=unknown
35ARG org_opencord_vcs_commit_date=unknown
36ARG org_opencord_vcs_dirty=unknown
37ARG GO_JUNIT_REPORT_VERSION=unknown
38
39LABEL org.label-schema.schema-version=1.0 \
40 org.label-schema.name=voltha-protoc \
41 org.label-schema.version=$org_label_schema_version \
42 org.label-schema.vcs-url=$org_label_schema_vcs_url \
43 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
44 org.label-schema.build-date=$org_label_schema_build_date \
45 org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date \
46 org.opencord.vcs-dirty=$org_opencord_vcs_dirty \
47 org.opencord.go-junit-report-version=$GO_JUNIT_REPORT_VERSION