| |
| # Copyright 2017-present Open Networking Foundation |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| |
| FROM ubuntu:14.04.5 |
| LABEL maintainer "Open Networking Lab" |
| |
| # Install. |
| RUN \ |
| sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list && \ |
| apt-get update && \ |
| apt-get -y upgrade && \ |
| apt-get install -y curl git python-dev python-pip |
| |
| RUN pip install msgpack-python |
| RUN pip install oslo.utils |
| RUN pip install oslo.config |
| RUN pip install netifaces |
| RUN pip install Babel |
| RUN pip install Flask |
| RUN pip install kafka-python |
| RUN pip install wrapt |
| |
| #Clone cord monitoring repository |
| RUN git clone https://github.com/opencord/monitoring.git /opt/cord/monitoring/ |
| |
| WORKDIR /opt/cord/monitoring/xos/synchronizer/ceilometer/ceilometer_pub_sub/ |
| RUN chmod +x sub_main.py |
| |
| RUN echo "#!/bin/sh" > deploy-cord-publish-subscribe |
| RUN echo "if [ ! -z \"\$KAFKA_URL\" ]; then sed -r -i \"s,^(target) = (.*),target = \$KAFKA_URL,g\" pub_sub.conf; fi" >> deploy-cord-publish-subscribe |
| RUN echo "python sub_main.py" >> deploy-cord-publish-subscribe |
| RUN chmod +x deploy-cord-publish-subscribe |
| |
| CMD ["./deploy-cord-publish-subscribe"] |