blob: 909ea3a2905397506ed410f644ad2a76c8287642 [file] [log] [blame]
Mike Marchetti13d76c82018-09-19 15:00:36 -04001# This creates som/LCM docker from from last stable package
2
3FROM ubuntu:16.04
4
5# Set the working directory to /app
6WORKDIR /app/osm_lcm
7
8# avoid extra information from packages
9RUN echo 'path-exclude /usr/share/doc/*\n\
10path-include /usr/share/doc/*/copyright\n\
11path-exclude /usr/share/man/*\n\
12path-exclude /usr/share/groff/*\n\
13path-exclude /usr/share/info/*\n\
14path-exclude /usr/share/lintian/*\n\
15path-exclude /usr/share/linda/*\n'\
16> /etc/dpkg/dpkg.cfg.d/01_nodoc && \
17 echo 'APT::Install-Recommends "false";\n\
18APT::AutoRemove::RecommendsImportant "false";\n\
19APT::AutoRemove::SuggestsImportant "false";\n'\
20> /etc/apt/apt.conf.d/99_norecommends
21
22RUN apt-get update && apt-get -y install curl software-properties-common
23
24RUN apt-get update && apt-get install -y git make python3 \
25 python3-pip python3-pymongo python3-yaml python3-aiohttp \
Michael Marchettib1287f52018-10-31 22:23:02 +000026 python3-all python3-setuptools openssh-client libffi-dev libssl-dev \
Mike Marchetti13d76c82018-09-19 15:00:36 -040027 python3-bitarray python3-regex python3-lxml dh-python wget tox \
28 python3-cffi \
29 && pip3 install pip==9.0.3 \
30 && pip3 install -U aiokafka pyang lxml six enum34 \
31 && pip3 install websockets==4.0.1 \
Michael Marchettib1287f52018-10-31 22:23:02 +000032 && pip3 install requests \
33 && rm -rf /var/lib/apt/lists/*
garciadeblas77f468c2018-10-26 23:13:37 +020034
tierno38e11d72018-10-30 14:56:28 +010035# packages needed for N2VC because deb dependencies are not fine
36RUN pip3 install 'macaroonbakery>=1.1,<2.0' 'pyRFC3339>=1.0,<2.0' \
37 'pyyaml>=3.0,<4.0' 'theblues>=0.3.8,<1.0' 'websockets>=4.0,<5.0' \
38 'paramiko' # PyNaCl
39#
40# RUN git clone https://osm.etsi.org/gerrit/osm/N2VC.git \
41# && cd N2VC \
42# && cd modules/libjuju && python3 setup.py develop && cd ../.. \
43# && pip3 install -U -r requirements.txt
Mike Marchetti13d76c82018-09-19 15:00:36 -040044
45ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
46ARG RELEASE=ReleaseFOUR-daily
47ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
48ARG REPOSITORY=testing
49
50RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
51RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} LCM N2VC common" && apt update
52
53ARG LCM_VERSION
54ARG COMMON_VERSION
55ARG N2VC_VERSION
56
57RUN apt-get update && apt-get install -y python3-osm-lcm${LCM_VERSION} \
58 python3-osm-common${COMMON_VERSION} \
59 python3-n2vc${N2VC_VERSION} \
60 && rm -rf /var/lib/apt/lists/*
61
62EXPOSE 9999
63
64LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
65 Description="This implements life cycle management engine for OSM" \
66 Version="1.0" \
67 Author="Alfonso Tierno"
68
69# Used for local storage
70VOLUME /app/storage
71# Used for logs
72VOLUME /app/log
73
74# The following ENV can be added with "docker run -e xxx' to configure LCM
75ENV OSMLCM_RO_HOST ro
76ENV OSMLCM_RO_PORT 9090
77ENV OSMLCM_RO_TENANT osm
78
79# VCA
80ENV OSMLCM_VCA_HOST vca
81ENV OSMLCM_VCA_PORT: 17070
82ENV OSMLCM_VCA_USER: admin
83ENV OSMLCM_VCA_SECRET: secret
84
85# database
86ENV OSMLCM_DATABASE_DRIVER mongo
Juancc084d72018-11-16 11:08:07 -030087ENV OSMLCM_DATABASE_URI mongodb://mongo:27017
88#ENV OSMLCM_DATABASE_HOST mongo
89#ENV OSMLCM_DATABASE_PORT 27017
90
91
Mike Marchetti13d76c82018-09-19 15:00:36 -040092ENV OSMLCM_STORAGE_DRIVER local
93ENV OSMLCM_STORAGE_PATH /app/storage
94
95# message
96ENV OSMLCM_MESSAGE_DRIVER kafka
97ENV OSMLCM_MESSAGE_HOST kafka
98ENV OSMLCM_MESSAGE_PORT 9092
99
tierno84a3c9a2018-10-24 11:02:57 +0200100HEALTHCHECK --interval=30s --timeout=140s --retries=1 \
101 CMD python3 /usr/lib/python3/dist-packages/osm_lcm/lcm.py --health-check || exit 1
102
103
Mike Marchetti13d76c82018-09-19 15:00:36 -0400104# Run app.py when the container launches
105CMD ["python3", "/usr/lib/python3/dist-packages/osm_lcm/lcm.py"]