Matt Jeanneret | 18949ae | 2019-02-09 15:00:14 -0500 | [diff] [blame] | 1 | # 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 Jeanneret | 2e3cb8d | 2019-11-16 09:22:41 -0500 | [diff] [blame] | 14 | FROM voltha/voltha-python-base:2.0.0 |
Matt Jeanneret | 134d9e8 | 2019-05-08 15:45:10 -0400 | [diff] [blame] | 15 | |
| 16 | # Install adapter requirements. |
| 17 | COPY requirements.txt /tmp/requirements.txt |
Matt Jeanneret | 2e3cb8d | 2019-11-16 09:22:41 -0500 | [diff] [blame] | 18 | RUN pip install --no-cache-dir -r /tmp/requirements.txt |
Matt Jeanneret | 134d9e8 | 2019-05-08 15:45:10 -0400 | [diff] [blame] | 19 | |
| 20 | ARG LOCAL_PYVOLTHA |
| 21 | ARG LOCAL_PROTOS |
| 22 | COPY local_imports/ /local_imports/ |
| 23 | RUN if [ -n "$LOCAL_PYVOLTHA" ] ; then \ |
Matt Jeanneret | 2e3cb8d | 2019-11-16 09:22:41 -0500 | [diff] [blame] | 24 | pip install --no-cache-dir /local_imports/pyvoltha/dist/*.tar.gz ; \ |
Matt Jeanneret | 134d9e8 | 2019-05-08 15:45:10 -0400 | [diff] [blame] | 25 | fi |
| 26 | |
| 27 | RUN if [ -n "$LOCAL_PROTOS" ] ; then \ |
Matt Jeanneret | 2e3cb8d | 2019-11-16 09:22:41 -0500 | [diff] [blame] | 28 | pip install --no-cache-dir /local_imports/voltha-protos/dist/*.tar.gz ; \ |
Matt Jeanneret | 134d9e8 | 2019-05-08 15:45:10 -0400 | [diff] [blame] | 29 | fi |
Matt Jeanneret | 18949ae | 2019-02-09 15:00:14 -0500 | [diff] [blame] | 30 | |
| 31 | # Bundle app source |
Matt Jeanneret | 18949ae | 2019-02-09 15:00:14 -0500 | [diff] [blame] | 32 | ENV PYTHONPATH=/voltha |
Matt Jeanneret | 72f96fc | 2019-02-11 10:53:05 -0500 | [diff] [blame] | 33 | COPY adapters/brcm_openomci_onu /voltha/adapters/brcm_openomci_onu |
Matt Jeanneret | 18949ae | 2019-02-09 15:00:14 -0500 | [diff] [blame] | 34 | |
Matt Jeanneret | 134d9e8 | 2019-05-08 15:45:10 -0400 | [diff] [blame] | 35 | # Label image |
| 36 | ARG org_label_schema_version=unknown |
| 37 | ARG org_label_schema_vcs_url=unknown |
| 38 | ARG org_label_schema_vcs_ref=unknown |
| 39 | ARG org_label_schema_build_date=unknown |
| 40 | ARG org_opencord_vcs_commit_date=unknown |
Matt Jeanneret | 08a8e86 | 2019-12-20 14:02:32 -0500 | [diff] [blame] | 41 | ARG org_opencord_vcs_dirty=unknown |
| 42 | |
| 43 | RUN echo '[buildinfo]\n\ |
| 44 | version='$org_label_schema_version'\n\ |
| 45 | vcs_ref='$org_label_schema_vcs_ref'\n\ |
| 46 | vcs_dirty='$org_opencord_vcs_dirty'\n\ |
| 47 | build_time='$org_label_schema_build_date'\n '\ |
| 48 | > /voltha/adapters/brcm_openomci_onu/BUILDINFO |
Matt Jeanneret | 18949ae | 2019-02-09 15:00:14 -0500 | [diff] [blame] | 49 | |
Matt Jeanneret | 134d9e8 | 2019-05-08 15:45:10 -0400 | [diff] [blame] | 50 | LABEL org.label-schema.schema-version=1.0 \ |
| 51 | org.label-schema.name=voltha-openonu-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 |