blob: e808202a80efdc702991df796985829a92eecff2 [file] [log] [blame]
Matteo Scandoloa4285862020-12-01 18:10:10 -08001# 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
15# bbsim-sadis-server dockerfile
16
17# builder parent
David K. Bainbridge4242c722021-04-09 16:16:36 +000018FROM golang:1.16.3-stretch as builder
Matteo Scandoloa4285862020-12-01 18:10:10 -080019
20ENV CGO_ENABLED=1
21
22WORKDIR /app
23
24# copy and build
25COPY . ./
26
27RUN go build -mod vendor \
28 -ldflags "-w -X main.buildTime=$(date +%Y/%m/%d-%H:%M:%S) \
29 -X main.commitHash=$(git log --pretty=format:%H -n 1) \
30 -X main.gitStatus=${GIT_STATUS} \
31 -X main.version=${VERSION}" \
32 ./cmd/bbsim-sadis-server.go
33
34# runtime parent
35FROM ubuntu:18.04
36WORKDIR /app
37COPY --from=builder /app/bbsim-sadis-server /app/bbsim-sadis-server
38CMD [ "/app/bbsim-sadis-server" ]
39
40# Label image
41ARG org_label_schema_version=unknown
42ARG org_label_schema_vcs_url=unknown
43ARG org_label_schema_vcs_ref=unknown
44ARG org_label_schema_build_date=unknown
45ARG org_opencord_vcs_commit_date=unknown
46ARG org_opencord_vcs_dirty=unknown
47
48LABEL org.label-schema.schema-version=1.0 \
49 org.label-schema.name=voltha-rw-core \
50 org.label-schema.version=$org_label_schema_version \
51 org.label-schema.vcs-url=$org_label_schema_vcs_url \
52 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
53 org.label-schema.build-date=$org_label_schema_build_date \
54 org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date \
55 org.opencord.vcs-dirty=$org_opencord_vcs_dirty