blob: 7e7f71038a75ae79ace23bcce8268cd3e8441fcc [file] [log] [blame]
Elia Battistonac8d23f2022-03-14 17:54:56 +01001# 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
18FROM --platform=linux/amd64 golang:1.16.3-buster AS dev
19
20RUN mkdir -m 777 /.cache /go/pkg
21
22#Install golangci-lint
23RUN go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.44.2
24
25RUN \
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
30RUN \
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
36RUN dpkg -i libyang2.deb libyang2-dev.deb libsysrepo6.deb libsysrepo-dev.deb
37
38RUN rm libyang2.deb libyang2-dev.deb libsysrepo6.deb libsysrepo-dev.deb
39
40WORKDIR /app
41
42ARG org_label_schema_version=unknown
43ARG org_label_schema_vcs_url=unknown
44ARG org_label_schema_vcs_ref=unknown
45ARG org_label_schema_build_date=unknown
46ARG org_opencord_vcs_commit_date=unknown
47ARG org_opencord_vcs_dirty=unknown
48
49LABEL \
50org.label-schema.schema-version=1.0 \
51org.label-schema.name=voltha-northbound-bbf-adapter \
52org.label-schema.version=$org_label_schema_version \
53org.label-schema.vcs-url=$org_label_schema_vcs_url \
54org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
55org.label-schema.build-date=$org_label_schema_build_date \
56org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date \
57org.opencord.vcs-dirty=$org_opencord_vcs_dirty