Fixing Dockerfile.local
[osm/RO.git] / Dockerfile.local
1 ############################################################################
2 # Copyright 2021 ETSI
3 #
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
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
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
14 # under the License.
15 ############################################################################
16
17 FROM ubuntu:18.04 as INSTALL
18
19 WORKDIR /build
20
21 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
22     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
23     gcc python3 python3-dev python3-venv python3-pip \
24     python3-setuptools curl git genisoimage netbase && \
25     python3 -m pip install -U pip build
26
27 COPY . /build
28
29 RUN git clone https://osm.etsi.org/gerrit/osm/common.git
30
31 RUN python3 -m pip install -r requirements.txt \
32     -r common/requirements.txt
33
34 RUN python3 -m build /build/common && \
35     python3 -m pip install /build/common/dist/*.whl
36
37 RUN python3 -m build /build/RO-plugin && \
38     python3 -m pip install /build/RO-plugin/dist/*.whl
39
40 RUN python3 -m build /build/NG-RO && \
41     python3 -m pip install /build/NG-RO/dist/*.whl
42
43 RUN python3 -m build /build/RO-VIM-vmware && \
44     python3 -m pip install /build/RO-VIM-vmware/dist/*.whl
45
46 RUN python3 -m build /build/RO-VIM-openstack && \
47     python3 -m pip install /build/RO-VIM-openstack/dist/*.whl
48
49 RUN python3 -m build /build/RO-VIM-openvim && \
50     python3 -m pip install /build/RO-VIM-openvim/dist/*.whl
51
52 RUN python3 -m build /build/RO-VIM-aws && \
53     python3 -m pip install /build/RO-VIM-aws/dist/*.whl
54
55 RUN python3 -m build /build/RO-VIM-azure && \
56     python3 -m pip install /build/RO-VIM-azure/dist/*.whl
57
58 RUN python3 -m build /build/RO-VIM-fos && \
59     python3 -m pip install /build/RO-VIM-fos/dist/*.whl
60
61 RUN python3 -m build /build/RO-SDN-dynpac && \
62     python3 -m pip install /build/RO-SDN-dynpac/dist/*.whl
63
64 RUN python3 -m build /build/RO-SDN-ietfl2vpn && \
65     python3 -m pip install /build/RO-SDN-ietfl2vpn/dist/*.whl
66
67 RUN python3 -m build /build/RO-SDN-onos_vpls && \
68     python3 -m pip install /build/RO-SDN-onos_vpls/dist/*.whl
69
70 RUN python3 -m build /build/RO-SDN-onos_openflow && \
71     python3 -m pip install /build/RO-SDN-onos_openflow/dist/*.whl
72
73 RUN python3 -m build /build/RO-SDN-odl_openflow && \
74     python3 -m pip install /build/RO-SDN-odl_openflow/dist/*.whl
75
76 RUN python3 -m build /build/RO-SDN-floodlight_openflow && \
77     python3 -m pip install /build/RO-SDN-floodlight_openflow/dist/*.whl
78
79 RUN python3 -m build /build/RO-SDN-arista_cloudvision && \
80     python3 -m pip install /build/RO-SDN-arista_cloudvision/dist/*.whl
81
82 RUN python3 -m build /build/RO-SDN-juniper_contrail && \
83     python3 -m pip install /build/RO-SDN-juniper_contrail/dist/*.whl
84
85 FROM ubuntu:18.04
86
87 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
88     DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal
89
90 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
91 COPY --from=INSTALL /usr/local/lib/python3.6/dist-packages  /usr/local/lib/python3.6/dist-packages
92 COPY --from=INSTALL /usr/bin/genisoimage /usr/bin/genisoimage
93 COPY --from=INSTALL /etc/protocols /etc/protocols
94
95 VOLUME /var/log/osm
96
97 EXPOSE 9090
98
99 # Two mysql databases are needed (DB and DB_OVIM). Can be hosted on same or separated containers
100 # These ENV must be provided
101 ENV RO_DB_HOST=""
102 ENV RO_DB_OVIM_HOST=""
103     # if empty RO_DB_HOST is assumed
104
105 # These ENV should be provided first time for creating database. It will create and init only if empty!
106 ENV RO_DB_ROOT_PASSWORD=""
107 ENV RO_DB_OVIM_ROOT_PASSWORD=""
108     # if empty RO_DB_ROOT_PASSWORD is assumed
109
110 # These ENV can be provided, but default values are ok
111 ENV RO_DB_USER=mano
112 ENV RO_DB_OVIM_USER=mano
113 ENV RO_DB_PASSWORD=manopw
114 ENV RO_DB_OVIM_PASSWORD=manopw
115 ENV RO_DB_PORT=3306
116 ENV RO_DB_OVIM_PORT=3306
117 ENV RO_DB_NAME=mano_db
118 ENV RO_DB_OVIM_NAME=mano_vim_db
119 ENV OPENMANO_TENANT=osm
120
121 # database
122 ENV OSMRO_DATABASE_DRIVER mongo
123 ENV OSMRO_DATABASE_URI mongodb://mongo:27017
124 # ENV OSMRO_DATABASE_COMMONKEY  xxx
125 # ENV OSMRO_DATABASE_USER  xxx
126 # ENV OSMRO_DATABASE_PASSWORD  xxx
127
128 # message
129 ENV OSMRO_MESSAGE_DRIVER  kafka
130 ENV OSMRO_MESSAGE_HOST    kafka
131 ENV OSMRO_MESSAGE_PORT    9092
132
133 # logs
134 ENV OSMRO_LOG_LEVEL       INFO
135
136 CMD ["python3", "-u", "-m", "osm_ng_ro.ro_main"]