Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -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 | 1f5777d | 2019-10-23 10:42:52 -0400 | [diff] [blame^] | 14 | FROM voltha/voltha-python-base:1.0.0 |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 15 | |
| 16 | # Install adapter requirements. |
| 17 | COPY requirements.txt /tmp/requirements.txt |
| 18 | RUN pip install -r /tmp/requirements.txt |
| 19 | |
| 20 | ARG LOCAL_PYVOLTHA |
| 21 | ARG LOCAL_PROTOS |
| 22 | COPY local_imports/ /local_imports/ |
| 23 | RUN if [ -n "$LOCAL_PYVOLTHA" ] ; then \ |
William Kurkian | 190e38b | 2019-07-16 14:54:04 -0400 | [diff] [blame] | 24 | PYVOLTHA_PATH=$(ls /local_imports/pyvoltha/dist/) ; \ |
| 25 | printf "/local_imports/pyvoltha/dist/%s\npyvoltha" "$PYVOLTHA_PATH" > pyvoltha-install.txt ; \ |
| 26 | pip install -r pyvoltha-install.txt ; \ |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 27 | fi |
| 28 | |
| 29 | RUN if [ -n "$LOCAL_PROTOS" ] ; then \ |
William Kurkian | 190e38b | 2019-07-16 14:54:04 -0400 | [diff] [blame] | 30 | PROTOS_PATH=$(ls /local_imports/voltha-protos/dist/) ; \ |
| 31 | printf "/local_imports/voltha-protos/dist/%s\nvoltha-protos" "$PROTOS_PATH" > protos-install.txt ; \ |
| 32 | pip install -r protos-install.txt ; \ |
| 33 | fi |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 34 | |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 35 | # Bundle app source |
William Kurkian | fc0dcda | 2019-04-08 16:54:36 -0400 | [diff] [blame] | 36 | RUN mkdir /ofagent && \ |
David Bainbridge | 5f3619c | 2019-07-10 22:51:09 +0000 | [diff] [blame] | 37 | touch /ofagent/__init__.py |
William Kurkian | fc0dcda | 2019-04-08 16:54:36 -0400 | [diff] [blame] | 38 | |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 39 | ENV PYTHONPATH=/ofagent |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 40 | COPY ofagent /ofagent/ofagent |
| 41 | COPY pki /ofagent/pki |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 42 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 43 | # Label image |
| 44 | ARG org_label_schema_version=unknown |
| 45 | ARG org_label_schema_vcs_url=unknown |
| 46 | ARG org_label_schema_vcs_ref=unknown |
| 47 | ARG org_label_schema_build_date=unknown |
| 48 | ARG org_opencord_vcs_commit_date=unknown |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 49 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 50 | LABEL org.label-schema.schema-version=1.0 \ |
| 51 | org.label-schema.name=voltha-ofagent \ |
| 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 |