4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
17 ########################################################################
19 # This creates som/LCM docker from from last stable package
23 # Set the working directory to /app
26 # avoid extra information from packages
27 RUN echo 'path-exclude /usr/share/doc/*\n\
28 path-include /usr/share/doc/*/copyright\n\
29 path-exclude /usr/share/man/*\n\
30 path-exclude /usr/share/groff/*\n\
31 path-exclude /usr/share/info/*\n\
32 path-exclude /usr/share/lintian/*\n\
33 path-exclude /usr/share/linda/*\n'\
34 > /etc/dpkg/dpkg.cfg.d/01_nodoc && \
35 echo 'APT::Install-Recommends "false";\n\
36 APT::AutoRemove::RecommendsImportant "false";\n\
37 APT::AutoRemove::SuggestsImportant "false";\n'\
38 > /etc/apt/apt.conf.d/99_norecommends
40 RUN apt-get update && apt-get -y install curl software-properties-common
42 RUN apt-get update && apt-get install -y git make python3 \
43 python3-pip python3-pymongo python3-aiohttp \
44 python3-all python3-setuptools openssh-client libffi-dev libssl-dev \
45 python3-bitarray python3-regex python3-lxml dh-python wget tox \
47 && pip3 install -U pip \
48 && python3 -m pip install -U aiokafka lxml six enum34 \
49 && python3 -m pip install requests \
50 && rm -rf /var/lib/apt/lists/*
52 # packages needed for N2VC because deb dependencies are not fine
53 RUN python3 -m pip install -U juju
55 # RUN git clone https://osm.etsi.org/gerrit/osm/N2VC.git \
57 # && cd modules/libjuju && python3 setup.py develop && cd ../.. \
58 # && python3 -m pip install -U -r requirements.txt
60 ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
61 ARG RELEASE=ReleaseFOUR-daily
62 ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
63 ARG REPOSITORY=testing
65 RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
66 RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} LCM N2VC common" && apt update
72 RUN apt-get update && apt-get install -y python3-osm-lcm${LCM_VERSION} \
73 python3-osm-common${COMMON_VERSION} \
74 python3-n2vc${N2VC_VERSION} \
75 && rm -rf /var/lib/apt/lists/*
79 LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
80 Description="This implements life cycle management engine for OSM" \
82 Author="Alfonso Tierno"
84 # Used for local storage
89 # The following ENV can be added with "docker run -e xxx' to configure LCM
91 ENV OSMLCM_RO_PORT 9090
92 ENV OSMLCM_RO_TENANT osm
95 ENV OSMLCM_VCA_HOST vca
96 ENV OSMLCM_VCA_PORT: 17070
97 ENV OSMLCM_VCA_USER: admin
98 ENV OSMLCM_VCA_SECRET: secret
101 ENV OSMLCM_DATABASE_DRIVER mongo
102 ENV OSMLCM_DATABASE_URI mongodb://mongo:27017
103 #ENV OSMLCM_DATABASE_HOST mongo
104 #ENV OSMLCM_DATABASE_PORT 27017
107 ENV OSMLCM_STORAGE_DRIVER local
108 ENV OSMLCM_STORAGE_PATH /app/storage
111 ENV OSMLCM_MESSAGE_DRIVER kafka
112 ENV OSMLCM_MESSAGE_HOST kafka
113 ENV OSMLCM_MESSAGE_PORT 9092
115 HEALTHCHECK --start-period=120s --interval=30s --timeout=30s --retries=1 \
116 CMD python3 -m osm_lcm.lcm --health-check || exit 1
119 # Run app.py when the container launches
120 CMD python3 -m osm_lcm.lcm