1 # Copyright 2018 Telefonica S.A.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 # Set the working directory to /app
21 RUN apt-get update && apt-get install -y curl xz-utils \
22 && apt-get update && apt-get install -y apt-transport-https \
23 && curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - \
24 && echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list \
25 && apt-get update && apt-get install -y kubectl
27 RUN curl https://get.helm.sh/helm-v2.15.2-linux-amd64.tar.gz --output helm-v2.15.2.tar.gz \
28 && tar -zxvf helm-v2.15.2.tar.gz \
29 && mv linux-amd64/helm /usr/local/bin/helm \
32 RUN curl -L https://launchpad.net/juju/2.7/2.7.0/+download/juju-2.7.0-k8s.tar.xz --output juju-2.7.0-k8s.tar.xz \
33 && tar -xvf juju-2.7.0-k8s.tar.xz \
34 && mv juju /usr/local/bin/juju
36 RUN apt-get update && apt-get install -y git tox python3 \
37 python3-pip python3-aiohttp python3-jinja2 \
38 && python3 -m pip install pip --upgrade \
39 && python3 -m pip install -U 'PyYAML==3.*' 'aiohttp==0.20.2' flake8
41 RUN git -C /app clone https://osm.etsi.org/gerrit/osm/N2VC.git \
42 && python3 -m pip install -e /app/N2VC \
43 && python3 -m pip install -U juju \
44 && apt-get install -y libffi-dev libssl-dev openssh-client
45 # cd N2VC; python3 setup.py develop
46 # cd modules/libjuju; python3 setup.py develop
48 RUN git -C /app clone https://osm.etsi.org/gerrit/osm/common.git \
49 && python3 -m pip install -e /app/common
50 # python3-pymongo python3-yaml pycrypto aiokafka
52 RUN mkdir -p /app/storage/kafka && mkdir -p /app/log
55 LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
56 Description="This implements the Life Cicle Management module of OSM" \
58 Author="Alfonso Tierno"
60 # Used for local storage
65 # The following ENV can be added with "docker run -e xxx' to configure LCM
67 ENV OSMLCM_RO_PORT 9090
68 ENV OSMLCM_RO_TENANT osm
71 ENV OSMLCM_VCA_HOST vca
72 ENV OSMLCM_VCA_PORT: 17070
73 ENV OSMLCM_VCA_USER: admin
74 ENV OSMLCM_VCA_SECRET: secret
75 # ENV OSMLCM_VCA_PUBKEY: pubkey
76 # ENV OSMLCM_VCA_CACERT: cacert
79 ENV OSMLCM_DATABASE_DRIVER mongo
80 ENV OSMLCM_DATABASE_URI mongodb://mongo:27017
81 # ENV OSMLCM_DATABASE_COMMONKEY xxx
82 # ENV OSMLCM_DATABASE_USER xxx
83 # ENV OSMLCM_DATABASE_PASSWORD xxx
86 ENV OSMLCM_STORAGE_DRIVER local
87 ENV OSMLCM_STORAGE_PATH /app/storage
88 #ENV OSMLCM_STORAGE_DRIVER mongo
89 #ENV OSMNBI_STORAGE_URI mongodb://mongo:27017
90 #ENV OSMLCM_STORAGE_COLLECTION files
93 ENV OSMLCM_MESSAGE_DRIVER kafka
94 ENV OSMLCM_MESSAGE_HOST kafka
95 ENV OSMLCM_MESSAGE_PORT 9092
98 ENV OSMLCM_VCA_HELMPATH /usr/local/bin/helm
99 ENV OSMLCM_VCA_KUBECTLPATH /usr/bin/kubectl
100 ENV OSMLCM_VCA_JUJUPATH /usr/local/bin/juju
103 # ENV OSMLCM_GLOBAL_LOGFILE /app/log/lcm.log
104 ENV OSMLCM_GLOBAL_LOGLEVEL DEBUG
106 # Copy the current directory contents into the container at /app/LCM
109 # Run app.py when the container launches
110 CMD python3 -m osm_lcm.lcm
112 # HEALTHCHECK --interval=120s --timeout=15s --retries=1 \
113 # CMD python3 -m osm_lcm.lcm --health-check || exit 1