| calvinosanch | 29be7ef | 2019-07-24 10:45:04 +0000 | [diff] [blame] | 1 | ## |
| 2 | # Copyright {yyyy} {name of copyright owner} |
| 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 | ######################################################################## |
| 18 | |
| 19 | from ubuntu:18.04 |
| Gennadiy Dubina | 311ea74 | 2017-04-03 20:46:16 +0300 | [diff] [blame] | 20 | |
| garciadeblas | 0cb7df3 | 2018-02-07 03:22:37 +0100 | [diff] [blame] | 21 | LABEL authors="Gennadiy Dubina, Alfonso Tierno, Gerardo Garcia" |
| Gennadiy Dubina | 311ea74 | 2017-04-03 20:46:16 +0300 | [diff] [blame] | 22 | |
| garciadeblas | 0cb7df3 | 2018-02-07 03:22:37 +0100 | [diff] [blame] | 23 | RUN apt-get update && \ |
| 24 | DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common && \ |
| calvinosanch | 29be7ef | 2019-07-24 10:45:04 +0000 | [diff] [blame] | 25 | DEBIAN_FRONTEND=noninteractive apt-get update && \ |
| tierno | 9202102 | 2018-09-12 16:29:23 +0200 | [diff] [blame] | 26 | DEBIAN_FRONTEND=noninteractive apt-get -y install git python python-pip && \ |
| garciadeblas | 0cb7df3 | 2018-02-07 03:22:37 +0100 | [diff] [blame] | 27 | DEBIAN_FRONTEND=noninteractive apt-get -y install wget tox && \ |
| tierno | 9202102 | 2018-09-12 16:29:23 +0200 | [diff] [blame] | 28 | DEBIAN_FRONTEND=noninteractive pip2 install pip==9.0.3 && \ |
| 29 | DEBIAN_FRONTEND=noninteractive pip2 install -U progressbar pyvmomi pyvcloud==19.1.1 && \ |
| tierno | c26cf29 | 2019-05-14 11:22:45 +0000 | [diff] [blame] | 30 | DEBIAN_FRONTEND=noninteractive pip2 install -U fog05rest && \ |
| tierno | 8dc9c8b | 2019-04-30 12:20:38 +0000 | [diff] [blame] | 31 | DEBIAN_FRONTEND=noninteractive pip2 install -U azure && \ |
| tierno | c26cf29 | 2019-05-14 11:22:45 +0000 | [diff] [blame] | 32 | DEBIAN_FRONTEND=noninteractive apt-get -y install python-requests && \ |
| garciadeblas | ebd6672 | 2019-01-31 16:01:31 +0000 | [diff] [blame] | 33 | DEBIAN_FRONTEND=noninteractive apt-get -y install python-novaclient python-keystoneclient python-glanceclient python-cinderclient python-neutronclient python-networking-l2gw && \ |
| tierno | 9202102 | 2018-09-12 16:29:23 +0200 | [diff] [blame] | 34 | DEBIAN_FRONTEND=noninteractive apt-get -y install python-cffi libmysqlclient-dev libssl-dev libffi-dev python-mysqldb && \ |
| 35 | DEBIAN_FRONTEND=noninteractive apt-get -y install python-openstacksdk python-openstackclient && \ |
| Anderson Bravalheri | c5293de | 2018-11-28 17:21:26 +0000 | [diff] [blame] | 36 | DEBIAN_FRONTEND=noninteractive apt-get -y install python-networkx && \ |
| Ananda Baitharu | 319c26f | 2019-03-05 17:34:31 +0000 | [diff] [blame] | 37 | DEBIAN_FRONTEND=noninteractive apt-get -y install genisoimage && \ |
| tierno | 9202102 | 2018-09-12 16:29:23 +0200 | [diff] [blame] | 38 | DEBIAN_FRONTEND=noninteractive pip2 install untangle && \ |
| jomacarpe | 20c1323 | 2019-06-12 21:20:51 +0000 | [diff] [blame] | 39 | DEBIAN_FRONTEND=noninteractive pip2 install pyone && \ |
| tierno | 9202102 | 2018-09-12 16:29:23 +0200 | [diff] [blame] | 40 | DEBIAN_FRONTEND=noninteractive pip2 install -e git+https://github.com/python-oca/python-oca#egg=oca && \ |
| Eduardo Sousa | ab24d8b | 2018-10-17 17:10:04 +0100 | [diff] [blame] | 41 | DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-client |
| 42 | |
| 43 | COPY . /root/RO |
| 44 | |
| 45 | RUN /root/RO/scripts/install-osm-im.sh --develop && \ |
| tierno | 9202102 | 2018-09-12 16:29:23 +0200 | [diff] [blame] | 46 | /root/RO/scripts/install-lib-osm-openvim.sh --develop && \ |
| 47 | make -C /root/RO prepare && \ |
| 48 | mkdir -p /var/log/osm && \ |
| 49 | pip2 install -e /root/RO/build && \ |
| garciadeblas | 0cb7df3 | 2018-02-07 03:22:37 +0100 | [diff] [blame] | 50 | rm -rf /root/.cache && \ |
| 51 | apt-get clean && \ |
| tierno | 9202102 | 2018-09-12 16:29:23 +0200 | [diff] [blame] | 52 | rm -rf /var/lib/apt/lists/* |
| garciadeblas | 0cb7df3 | 2018-02-07 03:22:37 +0100 | [diff] [blame] | 53 | |
| 54 | VOLUME /var/log/osm |
| tierno | d4d5e25 | 2018-01-23 17:07:46 +0100 | [diff] [blame] | 55 | |
| Gennadiy Dubina | 311ea74 | 2017-04-03 20:46:16 +0300 | [diff] [blame] | 56 | EXPOSE 9090 |
| 57 | |
| tierno | d4d5e25 | 2018-01-23 17:07:46 +0100 | [diff] [blame] | 58 | # Two mysql databases are needed (DB and DB_OVIM). Can be hosted on same or separated containers |
| 59 | # These ENV must be provided |
| garciadeblas | 0cb7df3 | 2018-02-07 03:22:37 +0100 | [diff] [blame] | 60 | # RO_DB_HOST: host of the main |
| 61 | # RO_DB_OVIM_HOST: ... if empty RO_DB_HOST is assumed |
| 62 | # RO_DB_ROOT_PASSWORD: this has to be provided first time for creating database. It will create and init only if empty! |
| 63 | # RO_DB_OVIM_ROOT_PASSWORD: ... if empty RO_DB_ROOT_PASSWORD is assumed |
| 64 | # RO_DB_USER: default value 'mano' |
| 65 | # RO_DB_OVIM_USER: default value 'mano' |
| 66 | # RO_DB_PASSWORD: default value 'manopw' |
| 67 | # RO_DB_OVIM_PASSWORD: default value 'manopw' |
| 68 | # RO_DB_PORT: default value '3306' |
| 69 | # RO_DB_OVIM_PORT: default value '3306' |
| 70 | # RO_DB_NAME: default value 'mano_db' |
| 71 | # RO_DB_OVIM_NAME: default value 'mano_vim_db' |
| tierno | 307a1ca | 2018-10-25 14:27:36 +0200 | [diff] [blame] | 72 | # RO_LOG_FILE: default log to stderr if not defined |
| Gennadiy Dubina | 311ea74 | 2017-04-03 20:46:16 +0300 | [diff] [blame] | 73 | |
| garciadeblas | 0cb7df3 | 2018-02-07 03:22:37 +0100 | [diff] [blame] | 74 | ENV RO_DB_HOST="" \ |
| 75 | RO_DB_OVIM_HOST="" \ |
| 76 | RO_DB_ROOT_PASSWORD="" \ |
| 77 | RO_DB_OVIM_ROOT_PASSWORD="" \ |
| 78 | RO_DB_USER=mano \ |
| 79 | RO_DB_OVIM_USER=mano \ |
| 80 | RO_DB_PASSWORD=manopw \ |
| 81 | RO_DB_OVIM_PASSWORD=manopw \ |
| 82 | RO_DB_PORT=3306 \ |
| 83 | RO_DB_OVIM_PORT=3306 \ |
| 84 | RO_DB_NAME=mano_db \ |
| tierno | b8569aa | 2018-08-24 11:34:54 +0200 | [diff] [blame] | 85 | RO_DB_OVIM_NAME=mano_vim_db \ |
| tierno | 307a1ca | 2018-10-25 14:27:36 +0200 | [diff] [blame] | 86 | OPENMANO_TENANT=osm \ |
| 87 | RO_LOG_LEVEL=DEBUG |
| tierno | d4d5e25 | 2018-01-23 17:07:46 +0100 | [diff] [blame] | 88 | |
| tierno | 12690ed | 2018-09-14 21:16:19 +0000 | [diff] [blame] | 89 | CMD RO-start.sh |
| tierno | 2cff346 | 2018-12-04 14:05:26 +0000 | [diff] [blame] | 90 | |
| 91 | # HEALTHCHECK --start-period=30s --interval=10s --timeout=5s --retries=12 \ |
| 92 | # CMD curl --silent --fail localhost:9090/openmano/tenants || exit 1 |