Elia Battiston | ac8d23f | 2022-03-14 17:54:56 +0100 | [diff] [blame^] | 1 | # Copyright 2022-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 | # Dockerfile with golang and the sysrepo dependencies for voltha-northbound-bff-adapter |
| 16 | # This image is used for testing, static code analysis and building |
| 17 | |
| 18 | FROM --platform=linux/amd64 golang:1.16.3-buster AS dev |
| 19 | |
| 20 | RUN mkdir -m 777 /.cache /go/pkg |
| 21 | |
| 22 | #Install golangci-lint |
| 23 | RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2 |
| 24 | |
| 25 | RUN \ |
| 26 | apt-get update && apt-get install -y libpcre2-dev=10.32-5 --no-install-recommends && \ |
| 27 | rm -rf /var/lib/apt/lists/* |
| 28 | |
| 29 | # Download and install library packages |
| 30 | RUN \ |
| 31 | wget https://github.com/CESNET/libyang/releases/download/v2.0.112/libyang2_2.0.112.1-1_amd64.deb -O libyang2.deb && \ |
| 32 | wget https://github.com/CESNET/libyang/releases/download/v2.0.112/libyang2-dev_2.0.112.1-1_amd64.deb -O libyang2-dev.deb && \ |
| 33 | wget https://github.com/sysrepo/sysrepo/releases/download/v2.0.53/libsysrepo6_2.0.53.1-1_amd64.deb -O libsysrepo6.deb && \ |
| 34 | wget https://github.com/sysrepo/sysrepo/releases/download/v2.0.53/libsysrepo-dev_2.0.53.1-1_amd64.deb -O libsysrepo-dev.deb |
| 35 | |
| 36 | RUN dpkg -i libyang2.deb libyang2-dev.deb libsysrepo6.deb libsysrepo-dev.deb |
| 37 | |
| 38 | RUN rm libyang2.deb libyang2-dev.deb libsysrepo6.deb libsysrepo-dev.deb |
| 39 | |
| 40 | WORKDIR /app |
| 41 | |
| 42 | ARG org_label_schema_version=unknown |
| 43 | ARG org_label_schema_vcs_url=unknown |
| 44 | ARG org_label_schema_vcs_ref=unknown |
| 45 | ARG org_label_schema_build_date=unknown |
| 46 | ARG org_opencord_vcs_commit_date=unknown |
| 47 | ARG org_opencord_vcs_dirty=unknown |
| 48 | |
| 49 | LABEL \ |
| 50 | org.label-schema.schema-version=1.0 \ |
| 51 | org.label-schema.name=voltha-northbound-bbf-adapter \ |
| 52 | org.label-schema.version=$org_label_schema_version \ |
| 53 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 54 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 55 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 56 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date \ |
| 57 | org.opencord.vcs-dirty=$org_opencord_vcs_dirty |