| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 1 | ## |
| 2 | # Copyright 2019 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 | ######################################################################## |
| 18 | |
| 19 | from ubuntu:18.04 |
| 20 | |
| 21 | MAINTAINER Alfonso Tierno <alfonso.tiernosepulveda@telefoncia.com> |
| 22 | |
| 23 | RUN apt-get update && apt-get -y install curl software-properties-common git tox python3-pip \ |
| tierno | a75bbb5 | 2020-03-11 14:49:37 +0000 | [diff] [blame] | 24 | && python3 -m pip install --upgrade pip && python3 -m pip install pyangbind networking-l2gw |
| tierno | 7d782ef | 2019-10-04 12:56:31 +0000 | [diff] [blame] | 25 | |
| 26 | ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian |
| 27 | ARG RELEASE=ReleaseSIX-daily |
| 28 | ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg |
| 29 | ARG REPOSITORY=testing |
| 30 | |
| 31 | RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add - |
| 32 | RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} IM common openvim" && apt-get update |
| 33 | |
| 34 | ARG RO_VERSION |
| 35 | ARG IM_VERSION |
| 36 | |
| 37 | COPY temp /app |
| 38 | RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3-osm-im${IM_VERSION} \ |
| 39 | && DEBIAN_FRONTEND=noninteractive dpkg -i --force-depends /app/*.deb \ |
| 40 | && DEBIAN_FRONTEND=noninteractive apt-get -y -f install |
| 41 | |
| 42 | EXPOSE 9090 |
| 43 | |
| 44 | # Two mysql databases are needed (DB and DB_OVIM). Can be hosted on same or separated containers |
| 45 | # These ENV must be provided |
| 46 | ENV RO_DB_HOST="" |
| 47 | ENV RO_DB_OVIM_HOST="" |
| 48 | # if empty RO_DB_HOST is assumed |
| 49 | |
| 50 | # These ENV should be provided first time for creating database. It will create and init only if empty! |
| 51 | ENV RO_DB_ROOT_PASSWORD="" |
| 52 | ENV RO_DB_OVIM_ROOT_PASSWORD="" |
| 53 | # if empty RO_DB_ROOT_PASSWORD is assumed |
| 54 | |
| 55 | # These ENV can be provided, but default values are ok |
| 56 | ENV RO_DB_USER=mano |
| 57 | ENV RO_DB_OVIM_USER=mano |
| 58 | ENV RO_DB_PASSWORD=manopw |
| 59 | ENV RO_DB_OVIM_PASSWORD=manopw |
| 60 | ENV RO_DB_PORT=3306 |
| 61 | ENV RO_DB_OVIM_PORT=3306 |
| 62 | ENV RO_DB_NAME=mano_db |
| 63 | ENV RO_DB_OVIM_NAME=mano_vim_db |
| 64 | |
| 65 | CMD RO-start.sh |