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 | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame^] | 14 | FROM ubuntu:16.04 |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 15 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame^] | 16 | # Update to have latest images |
| 17 | RUN apt-get update && \ |
| 18 | apt-get install -y python openssl iproute2 libpcap-dev wget build-essential git binutils python-dev libffi-dev libssl-dev |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 19 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame^] | 20 | # Install current version of pip rather than outdated pip from apt |
| 21 | RUN wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py |
| 22 | RUN python /tmp/get-pip.py |
| 23 | |
| 24 | # Install adapter requirements. |
| 25 | COPY requirements.txt /tmp/requirements.txt |
| 26 | RUN pip install -r /tmp/requirements.txt |
| 27 | |
| 28 | ARG LOCAL_PYVOLTHA |
| 29 | ARG LOCAL_PROTOS |
| 30 | COPY local_imports/ /local_imports/ |
| 31 | RUN if [ -n "$LOCAL_PYVOLTHA" ] ; then \ |
| 32 | pip install /local_imports/pyvoltha/dist/*.tar.gz ; \ |
| 33 | fi |
| 34 | |
| 35 | RUN if [ -n "$LOCAL_PROTOS" ] ; then \ |
| 36 | pip install /local_imports/voltha-protos/dist/*.tar.gz ; \ |
| 37 | fi |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 38 | |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 39 | # Bundle app source |
William Kurkian | fc0dcda | 2019-04-08 16:54:36 -0400 | [diff] [blame] | 40 | RUN mkdir /ofagent && \ |
| 41 | touch /ofagent/__init__.py |
| 42 | |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 43 | ENV PYTHONPATH=/ofagent |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 44 | COPY ofagent /ofagent/ofagent |
| 45 | COPY pki /ofagent/pki |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 46 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame^] | 47 | # Label image |
| 48 | ARG org_label_schema_version=unknown |
| 49 | ARG org_label_schema_vcs_url=unknown |
| 50 | ARG org_label_schema_vcs_ref=unknown |
| 51 | ARG org_label_schema_build_date=unknown |
| 52 | ARG org_opencord_vcs_commit_date=unknown |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 53 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame^] | 54 | LABEL org.label-schema.schema-version=1.0 \ |
| 55 | org.label-schema.name=voltha-ofagent \ |
| 56 | org.label-schema.version=$org_label_schema_version \ |
| 57 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 58 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 59 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 60 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |