blob: c0eea4118c759b3ec5e6f44c8a5fa44be06f939a [file] [log] [blame]
Matt Jeanneret18949ae2019-02-09 15:00:14 -05001# Copyright 2016 the original author or authors.
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.
Matt Jeanneret134d9e82019-05-08 15:45:10 -040014FROM ubuntu:16.04
Matt Jeanneret18949ae2019-02-09 15:00:14 -050015
Matt Jeanneret134d9e82019-05-08 15:45:10 -040016# Update to have latest images
17RUN apt-get update && \
18 apt-get install -y python openssl iproute2 libpcap-dev wget build-essential git binutils python-dev libffi-dev libssl-dev
Matt Jeanneret18949ae2019-02-09 15:00:14 -050019
Matt Jeanneret134d9e82019-05-08 15:45:10 -040020# Install current version of pip rather than outdated pip from apt
21RUN wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
22RUN python /tmp/get-pip.py
23
24# Install adapter requirements.
25COPY requirements.txt /tmp/requirements.txt
26RUN pip install -r /tmp/requirements.txt
27
28ARG LOCAL_PYVOLTHA
29ARG LOCAL_PROTOS
30COPY local_imports/ /local_imports/
31RUN if [ -n "$LOCAL_PYVOLTHA" ] ; then \
32 pip install /local_imports/pyvoltha/dist/*.tar.gz ; \
33fi
34
35RUN if [ -n "$LOCAL_PROTOS" ] ; then \
36 pip install /local_imports/voltha-protos/dist/*.tar.gz ; \
37fi
Matt Jeanneret18949ae2019-02-09 15:00:14 -050038
39# Bundle app source
40RUN mkdir /voltha && touch /voltha/__init__.py
Matt Jeanneret72f96fc2019-02-11 10:53:05 -050041RUN mkdir /voltha/adapters && touch /voltha/adapters/__init__.py
Matt Jeanneret18949ae2019-02-09 15:00:14 -050042ENV PYTHONPATH=/voltha
Matt Jeanneret72f96fc2019-02-11 10:53:05 -050043COPY adapters/brcm_openomci_onu /voltha/adapters/brcm_openomci_onu
Matt Jeanneret18949ae2019-02-09 15:00:14 -050044
Matt Jeanneret134d9e82019-05-08 15:45:10 -040045# Label image
46ARG org_label_schema_version=unknown
47ARG org_label_schema_vcs_url=unknown
48ARG org_label_schema_vcs_ref=unknown
49ARG org_label_schema_build_date=unknown
50ARG org_opencord_vcs_commit_date=unknown
Matt Jeanneret18949ae2019-02-09 15:00:14 -050051
Matt Jeanneret134d9e82019-05-08 15:45:10 -040052LABEL org.label-schema.schema-version=1.0 \
53 org.label-schema.name=voltha-openonu-adapter \
54 org.label-schema.version=$org_label_schema_version \
55 org.label-schema.vcs-url=$org_label_schema_vcs_url \
56 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
57 org.label-schema.build-date=$org_label_schema_build_date \
58 org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date