from ubuntu:xenial
-MAINTAINER Gennadiy Dubina <gennadiy.dubina@dataat.com>
-
-# script uses it
-ENV USER=root
+MAINTAINER Gennadiy Dubina <gennadiy.dubina@dataat.com>; Alfonso Tierno <alfonso.tiernosepulveda@telefoncia.com>
#avoid extra information from packages
RUN echo 'path-exclude /usr/share/doc/*\n\
APT::AutoRemove::SuggestsImportant "false";\n'\
> /etc/apt/apt.conf.d/99_norecommends
-#generate lsb_release stub
-RUN echo 'if [ "$1" == "-is" ]; then echo "Ubuntu"; else if [ "$1" == "-rs" ]; then echo "16.04"; fi fi' > /usr/bin/lsb_release && chmod +x /usr/bin/lsb_release
-
-COPY . /usr/local/src/openmano
-
-RUN apt update && \
- DEBIAN_FRONTEND=noninteractive apt install -fqy software-properties-common make gcc git python python-dev python-pip sudo wget && \
- pip install --upgrade pip && \
- cd /usr/local/src/openmano && \
- make build && \
- cd build && \
- ./scripts/install-openmano.sh -q --noclone --no-db && \
- cd / && \
- rm -rf /usr/local/src/openmano && \
- rm -rf /usr/include/* && \
- rm -rf /root/.cache && \
- apt purge -y make gcc git curl wget python-dev python-pip && \
- apt autoremove -y && \
- apt clean && \
- rm -rf /var/lib/apt/lists/*
-
-COPY docker/scripts/ /opt/openmano-docker
+
+RUN apt update && apt install -y curl mysql-client software-properties-common \
+ && add-apt-repository -y "deb http://osm-download.etsi.org/repository/osm/debian/ReleaseTHREE stable SO UI RO IM osmclient openvim" \
+ && curl "http://osm-download.etsi.org/repository/osm/debian/ReleaseTHREE/OSM%20ETSI%20Release%20Key.gpg" | apt-key add - \
+ && apt update \
+ && apt install -y python-osm-ro \
+ && rm -rf /var/lib/apt/lists/* \
+ && mkdir -p /bin/RO
+
+
+COPY docker/scripts/ /bin/RO
VOLUME /opt/openmano/logs
+
EXPOSE 9090
-env DB_USER='' DB_PSWD='' DB_HOST='' DB_PORT=3306 DB_NAME=mano_db
+# Two mysql databases are needed (DB and DB_OVIM). Can be hosted on same or separated containers
+# These ENV must be provided
+ENV RO_DB_HOST=""
+ENV RO_DB_OVIM_HOST=""
+ # if empty RO_DB_HOST is assumed
+
+# These ENV should be provided first time for creating database. It will create and init only if empty!
+ENV RO_DB_ROOT_PASSWORD=""
+ENV RO_DB_OVIM_ROOT_PASSWORD=""
+ # if empty RO_DB_ROOT_PASSWORD is assumed
+
+# These ENV can be provided, but default values are ok
+ENV RO_DB_USER=mano
+ENV RO_DB_OVIM_USER=mano
+ENV RO_DB_PASSWORD=manopw
+ENV RO_DB_OVIM_PASSWORD=manopw
+ENV RO_DB_PORT=3306
+ENV RO_DB_OVIM_PORT=3306
+ENV RO_DB_NAME=mano_db
+ENV RO_DB_OVIM_NAME=mano_vim_db
+
+
+CMD /bin/RO/start.sh
-CMD /opt/openmano-docker/start.sh