Matteo Scandolo | eb0d11c | 2017-08-08 13:05:26 -0700 | [diff] [blame^] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
Srikanth Vavilapalli | 3171360 | 2017-03-03 00:50:18 +0000 | [diff] [blame] | 17 | FROM ubuntu:14.04.5 |
| 18 | LABEL maintainer "Open Networking Lab" |
| 19 | |
| 20 | # Install. |
| 21 | RUN \ |
| 22 | sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ |
| 23 | apt-get update && \ |
| 24 | apt-get -y upgrade && \ |
| 25 | apt-get install -y curl git python-dev python-pip |
| 26 | |
| 27 | RUN pip install msgpack-python |
| 28 | RUN pip install oslo.utils |
| 29 | RUN pip install oslo.config |
| 30 | RUN pip install netifaces |
| 31 | RUN pip install Babel |
| 32 | RUN pip install Flask |
| 33 | RUN pip install kafka-python |
| 34 | RUN pip install wrapt |
| 35 | |
| 36 | #Clone cord monitoring repository |
| 37 | RUN git clone https://github.com/opencord/monitoring.git /opt/cord/monitoring/ |
| 38 | |
| 39 | WORKDIR /opt/cord/monitoring/xos/synchronizer/ceilometer/ceilometer_pub_sub/ |
| 40 | RUN chmod +x sub_main.py |
| 41 | |
| 42 | RUN echo "#!/bin/sh" > deploy-cord-publish-subscribe |
| 43 | RUN echo "if [ ! -z \"\$KAFKA_URL\" ]; then sed -r -i \"s,^(target) = (.*),target = \$KAFKA_URL,g\" pub_sub.conf; fi" >> deploy-cord-publish-subscribe |
| 44 | RUN echo "python sub_main.py" >> deploy-cord-publish-subscribe |
| 45 | RUN chmod +x deploy-cord-publish-subscribe |
| 46 | |
| 47 | CMD ["./deploy-cord-publish-subscribe"] |