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 && \ |
David Bainbridge | 5f3619c | 2019-07-10 22:51:09 +0000 | [diff] [blame^] | 18 | apt-get install -y --no-install-recommends \ |
| 19 | ca-certificates=20170717~16.04.2 \ |
| 20 | python=2.7.12-1~16.04 \ |
| 21 | openssl=1.0.2g-1ubuntu4.15 \ |
| 22 | iproute2=4.3.0-1ubuntu3.16.04.5 \ |
| 23 | libpcap-dev=1.7.4-2 \ |
| 24 | wget=1.17.1-1ubuntu1.5 \ |
| 25 | build-essential=12.1ubuntu2 \ |
| 26 | git=1:2.7.4-0ubuntu1.6 \ |
| 27 | binutils=2.26.1-1ubuntu1~16.04.8 \ |
| 28 | python-dev=2.7.12-1~16.04 \ |
| 29 | libffi-dev=3.2.1-4 \ |
| 30 | libssl-dev=1.0.2g-1ubuntu4.15 \ |
| 31 | && apt-get clean && rm -rf /var/lib/apt/lists/* |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 32 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 33 | # Install current version of pip rather than outdated pip from apt |
| 34 | RUN wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py |
| 35 | RUN python /tmp/get-pip.py |
| 36 | |
| 37 | # Install adapter requirements. |
| 38 | COPY requirements.txt /tmp/requirements.txt |
| 39 | RUN pip install -r /tmp/requirements.txt |
| 40 | |
| 41 | ARG LOCAL_PYVOLTHA |
| 42 | ARG LOCAL_PROTOS |
| 43 | COPY local_imports/ /local_imports/ |
| 44 | RUN if [ -n "$LOCAL_PYVOLTHA" ] ; then \ |
David Bainbridge | 5f3619c | 2019-07-10 22:51:09 +0000 | [diff] [blame^] | 45 | pip install /local_imports/pyvoltha/dist/*.tar.gz==* ; \ |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 46 | fi |
| 47 | |
| 48 | RUN if [ -n "$LOCAL_PROTOS" ] ; then \ |
David Bainbridge | 5f3619c | 2019-07-10 22:51:09 +0000 | [diff] [blame^] | 49 | pip install /local_imports/voltha-protos/dist/*.tar.gz==* ; \ |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 50 | fi |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 51 | |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 52 | # Bundle app source |
William Kurkian | fc0dcda | 2019-04-08 16:54:36 -0400 | [diff] [blame] | 53 | RUN mkdir /ofagent && \ |
David Bainbridge | 5f3619c | 2019-07-10 22:51:09 +0000 | [diff] [blame^] | 54 | touch /ofagent/__init__.py |
William Kurkian | fc0dcda | 2019-04-08 16:54:36 -0400 | [diff] [blame] | 55 | |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 56 | ENV PYTHONPATH=/ofagent |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 57 | COPY ofagent /ofagent/ofagent |
| 58 | COPY pki /ofagent/pki |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 59 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 60 | # Label image |
| 61 | ARG org_label_schema_version=unknown |
| 62 | ARG org_label_schema_vcs_url=unknown |
| 63 | ARG org_label_schema_vcs_ref=unknown |
| 64 | ARG org_label_schema_build_date=unknown |
| 65 | ARG org_opencord_vcs_commit_date=unknown |
Stephane Barbarie | 6e1bd50 | 2018-11-05 22:44:45 -0500 | [diff] [blame] | 66 | |
Matt Jeanneret | 2e3051a | 2019-05-11 15:01:46 -0400 | [diff] [blame] | 67 | LABEL org.label-schema.schema-version=1.0 \ |
| 68 | org.label-schema.name=voltha-ofagent \ |
| 69 | org.label-schema.version=$org_label_schema_version \ |
| 70 | org.label-schema.vcs-url=$org_label_schema_vcs_url \ |
| 71 | org.label-schema.vcs-ref=$org_label_schema_vcs_ref \ |
| 72 | org.label-schema.build-date=$org_label_schema_build_date \ |
| 73 | org.opencord.vcs-commit-date=$org_opencord_vcs_commit_date |