blob: a6b5429025f4d0f6556a7a48437d50bf706a8b45 [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 \
26 python3-all python3-setuptools \
27 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 \
garciadeblasaa01e442018-10-24 16:36:14 +020032 && pip3 install requests \
33 && pip3 install PyNaCl
Mike Marchetti13d76c82018-09-19 15:00:36 -040034
35ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
36ARG RELEASE=ReleaseFOUR-daily
37ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
38ARG REPOSITORY=testing
39
40RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
41RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} LCM N2VC common" && apt update
42
43ARG LCM_VERSION
44ARG COMMON_VERSION
45ARG N2VC_VERSION
46
47RUN apt-get update && apt-get install -y python3-osm-lcm${LCM_VERSION} \
48 python3-osm-common${COMMON_VERSION} \
49 python3-n2vc${N2VC_VERSION} \
50 && rm -rf /var/lib/apt/lists/*
51
52EXPOSE 9999
53
54LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
55 Description="This implements life cycle management engine for OSM" \
56 Version="1.0" \
57 Author="Alfonso Tierno"
58
59# Used for local storage
60VOLUME /app/storage
61# Used for logs
62VOLUME /app/log
63
64# The following ENV can be added with "docker run -e xxx' to configure LCM
65ENV OSMLCM_RO_HOST ro
66ENV OSMLCM_RO_PORT 9090
67ENV OSMLCM_RO_TENANT osm
68
69# VCA
70ENV OSMLCM_VCA_HOST vca
71ENV OSMLCM_VCA_PORT: 17070
72ENV OSMLCM_VCA_USER: admin
73ENV OSMLCM_VCA_SECRET: secret
74
75# database
76ENV OSMLCM_DATABASE_DRIVER mongo
77ENV OSMLCM_DATABASE_HOST mongo
78ENV OSMLCM_DATABASE_PORT 27017
79ENV OSMLCM_STORAGE_DRIVER local
80ENV OSMLCM_STORAGE_PATH /app/storage
81
82# message
83ENV OSMLCM_MESSAGE_DRIVER kafka
84ENV OSMLCM_MESSAGE_HOST kafka
85ENV OSMLCM_MESSAGE_PORT 9092
86
87# Run app.py when the container launches
88CMD ["python3", "/usr/lib/python3/dist-packages/osm_lcm/lcm.py"]