# Copyright Robert Bosch GmbH, 2020. Part of the Eclipse Kuksa Project.
#
# All rights reserved. This configuration file is provided to you under the
# terms and conditions of the Eclipse Distribution License v1.0 which
# accompanies this distribution, and is available at
# http://www.eclipse.org/org/documents/edl-v10.php
# Quick docker for doing development

FROM ubuntu:20.04 as build

RUN apt-get  update && DEBIAN_FRONTEND="noninteractive" apt-get -y install libssl-dev  \
                        pkg-config \
                        build-essential \
                        gnupg2 \ 
                        wget \ 
                        software-properties-common \
                        git \
                        cmake \
                        libmosquitto-dev \
                        gcovr

#Build Boost 1.75
ENV BOOST_VER=1.75.0
ENV BOOST_VER_=1_75_0
RUN mkdir /buildboost
WORKDIR /buildboost
RUN wget   https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VER}/source/boost_${BOOST_VER_}.tar.bz2
RUN tar xvjf boost_${BOOST_VER_}.tar.bz2
WORKDIR /buildboost/boost_${BOOST_VER_}
RUN ./bootstrap.sh
RUN ./b2 -j 6 install


ADD . /kuksa.val
RUN  rm -rf /kuksa.val/build  && mkdir  /kuksa.val/build 
WORKDIR /kuksa.val/build
RUN cmake .. -DBUILD_UNIT_TEST=ON -DCMAKE_BUILD_TYPE=Coverage
RUN make -j8

CMD ./src/kuksa-val-server -c src/config.ini 

