X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=Dockerfile;h=e43a5780cbf926e0a51edb8d4249139dacf851eb;hb=e64778dac480d66d93449efd3e9767cea4f980f9;hp=7760f5667c686224b2ea0093a00d1837343f5622;hpb=cc230b624f61e7d689d81985668a17e88c088afe;p=ric-plt%2Fxapp-frame-cpp.git diff --git a/Dockerfile b/Dockerfile index 7760f56..e43a578 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ # -------------------------------------------------------------------------------------- -FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:4-u18.04-nng as buildenv +FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu20-c-go:1.0.0 as buildenv RUN mkdir /playpen RUN apt-get update && apt-get install -y cmake gcc make git g++ wget @@ -44,7 +44,7 @@ ARG SRC=. WORKDIR /playpen # Install RMr (runtime and dev) from debian package cached on packagecloud.io -ARG RMR_VER=4.8.0 +ARG RMR_VER=4.8.5 # if package cloud is actually working, this is preferred # @@ -58,16 +58,64 @@ ARG RMR_VER=4.8.0 COPY ${SRC}/build_rmr.sh /playpen/bin RUN bash /playpen/bin/build_rmr.sh -t ${RMR_VER} -COPY ${SRC}/CMakeLists.txt /playpen/factory/ -COPY ${SRC}/src /playpen/factory/src/ -COPY ${SRC}/test /playpen/factory/test/ +#building cpprestsdk +RUN apt-get install -y libcpprest-dev + +RUN apt-get install -y g++ git libboost-atomic-dev libboost-thread-dev libboost-system-dev libboost-date-time-dev libboost-regex-dev libboost-filesystem-dev libboost-random-dev libboost-chrono-dev libboost-serialization-dev libwebsocketpp-dev openssl libssl-dev ninja-build zlib1g-dev + +RUN git clone https://github.com/Microsoft/cpprestsdk.git casablanca && \ + cd casablanca && \ + mkdir build && \ + cd build && \ + cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -DCMAKE_INSTALL_PREFIX=/usr/local .. && \ + ninja && \ + ninja install && \ + cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -DBUILD_TESTS=OFF -DBUILD_SAMPLES=OFF -DCMAKE_INSTALL_PREFIX=/usr/local .. && \ + ninja && \ + ninja install && \ + rm -rf casablanca +#installing all dependicies for pistache +RUN apt-get update && apt-get install -y cmake gcc make \ +git g++ wget meson libcurl4-openssl-dev libssl-dev pkg-config ninja-build + + RUN git clone https://github.com/Tencent/rapidjson && \ + cd rapidjson && \ + mkdir build && \ + cd build && \ + cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. && \ + make install && \ + cd ../../ + #rm -rf rapidjson + +#building and installing pistache +RUN git clone https://github.com/pistacheio/pistache.git +RUN cd pistache && \ + meson setup build \ + --buildtype=release \ + -DPISTACHE_USE_SSL=true \ + -DPISTACHE_BUILD_EXAMPLES=true \ + -DPISTACHE_BUILD_TESTS=true \ + -DPISTACHE_BUILD_DOCS=false \ + --prefix="/usr/local" +RUN cd pistache/build && \ + ninja && \ + ninja install +RUN cp /usr/local/lib/x86_64-linux-gnu/libpistache* /usr/local/lib/ +RUN cp /usr/local/lib/x86_64-linux-gnu/pkgconfig/libpistache.pc /usr/local/lib/pkgconfig + +#install nlohmann json +RUN git clone https://github.com/nlohmann/json.git && cd json && cmake . && make install + +#install json-schema-validator +RUN git clone https://github.com/pboettch/json-schema-validator.git && cd json-schema-validator &&mkdir build &&cd build && cmake .. && make install + +#copy the content as git repo inside the container. +#COPY ${SRC}/CMakeLists.txt /playpen/factory/ +#COPY ${SRC}/src /playpen/factory/src/ +#COPY ${SRC}/test /playpen/factory/test/ COPY ${SRC}/examples /tmp/examples/ +COPY . /playpen/factory -# -# Run unit tests -# -COPY ${SRC}/test/* /playpen/factory/test/ -RUN cd /playpen/factory/test; bash unit_test.sh # Go to the factory and build our stuff # @@ -76,25 +124,38 @@ ENV C_INCLUDE_PATH=/usr/local/include RUN cd /playpen/factory; rm -fr .build; mkdir .build; cd .build; cmake .. -DDEV_PKG=1; make install; cmake .. -DDEV_PKG=0; make install -# ----- final, smaller image ---------------------------------- -FROM ubuntu:18.04 + +# +# Run unit tests will come after building process +# +COPY ${SRC}/test/* /playpen/factory/test/ +RUN cd /playpen/factory/test; bash unit_test.sh + + +# ----- final, smaller image ---------------------------------- +#FROM ubuntu:20.04 +FROM nexus3.o-ran-sc.org:10002/o-ran-sc/bldr-ubuntu20-c-go:1.0.0 # must add compile tools to make it a builder environmnent. If a build environment isn't needed # comment out the next line and reduce the image size by more than 180M. # RUN apt-get update && apt-get install -y --no-install-recommends make g++ # if bash doesn't cut it for run_replay grab a real shell and clean up as much as we can -RUN apt-get update; apt-get install -y ksh +#RUN apt-get update; apt-get install -y ksh RUN rm -fr /var/lib/apt/lists RUN mkdir -p /usr/local/include/ricxfcpp COPY --from=buildenv /usr/local/lib /usr/local/lib/ COPY --from=buildenv /usr/local/include/ricxfcpp /usr/local/include/ricxfcpp/ COPY --from=buildenv /usr/local/include/rmr /usr/local/include/rmr/ +COPY --from=buildenv /usr/local/include/cpprest /usr/local/include/cpprest/ +COPY --from=buildenv /usr/local/include/pplx /usr/local/include/pplx/ +COPY --from=buildenv /usr/local/include/pistache /usr/local/include/pistache/ ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib ENV C_INCLUDE_PATH=/usr/local/include WORKDIR /factory CMD [ "make" ] +