Matteo Scandolo | a428586 | 2020-12-01 18:10:10 -0800 | [diff] [blame] | 1 | # 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 |
| 18 | FROM golang:1.13.8-stretch as builder |
| 19 | |
| 20 | ENV CGO_ENABLED=1 |
| 21 | |
| 22 | WORKDIR /app |
| 23 | |
| 24 | # copy and build |
| 25 | COPY . ./ |
| 26 | |
| 27 | RUN 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 |
| 35 | FROM ubuntu:18.04 |
| 36 | WORKDIR /app |
| 37 | COPY --from=builder /app/bbsim-sadis-server /app/bbsim-sadis-server |
| 38 | CMD [ "/app/bbsim-sadis-server" ] |
| 39 | |
| 40 | # Label image |
| 41 | ARG org_label_schema_version=unknown |
| 42 | ARG org_label_schema_vcs_url=unknown |
| 43 | ARG org_label_schema_vcs_ref=unknown |
| 44 | ARG org_label_schema_build_date=unknown |
| 45 | ARG org_opencord_vcs_commit_date=unknown |
| 46 | ARG org_opencord_vcs_dirty=unknown |
| 47 | |
| 48 | LABEL 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 |