blob: f21cc9f2a65f36931bf8b18718addb1b0555573a [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 Jeanneret2e3cb8d2019-11-16 09:22:41 -050014FROM voltha/voltha-python-base:2.0.0
Matt Jeanneret134d9e82019-05-08 15:45:10 -040015
16# Install adapter requirements.
17COPY requirements.txt /tmp/requirements.txt
Matt Jeanneret2e3cb8d2019-11-16 09:22:41 -050018RUN pip install --no-cache-dir -r /tmp/requirements.txt
Matt Jeanneret134d9e82019-05-08 15:45:10 -040019
20ARG LOCAL_PYVOLTHA
21ARG LOCAL_PROTOS
22COPY local_imports/ /local_imports/
23RUN if [ -n "$LOCAL_PYVOLTHA" ] ; then \
Matt Jeanneret2e3cb8d2019-11-16 09:22:41 -050024 pip install --no-cache-dir /local_imports/pyvoltha/dist/*.tar.gz ; \
Matt Jeanneret134d9e82019-05-08 15:45:10 -040025fi
26
27RUN if [ -n "$LOCAL_PROTOS" ] ; then \
Matt Jeanneret2e3cb8d2019-11-16 09:22:41 -050028 pip install --no-cache-dir /local_imports/voltha-protos/dist/*.tar.gz ; \
Matt Jeanneret134d9e82019-05-08 15:45:10 -040029fi
Matt Jeanneret18949ae2019-02-09 15:00:14 -050030
31# Bundle app source
Matt Jeanneret18949ae2019-02-09 15:00:14 -050032ENV PYTHONPATH=/voltha
Matt Jeanneret72f96fc2019-02-11 10:53:05 -050033COPY adapters/brcm_openomci_onu /voltha/adapters/brcm_openomci_onu
Matt Jeanneret18949ae2019-02-09 15:00:14 -050034
Matt Jeanneret134d9e82019-05-08 15:45:10 -040035# Label image
36ARG org_label_schema_version=unknown
37ARG org_label_schema_vcs_url=unknown
38ARG org_label_schema_vcs_ref=unknown
39ARG org_label_schema_build_date=unknown
40ARG org_opencord_vcs_commit_date=unknown
Matt Jeanneret18949ae2019-02-09 15:00:14 -050041
Matt Jeanneret134d9e82019-05-08 15:45:10 -040042LABEL org.label-schema.schema-version=1.0 \
43 org.label-schema.name=voltha-openonu-adapter \
44 org.label-schema.version=$org_label_schema_version \
45 org.label-schema.vcs-url=$org_label_schema_vcs_url \
46 org.label-schema.vcs-ref=$org_label_schema_vcs_ref \
47 org.label-schema.build-date=$org_label_schema_build_date \
48 org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date