|
@@ -0,0 +1,53 @@
|
|
|
+FROM debian
|
|
|
+
|
|
|
+RUN apt-get update -y && apt-get install -y \
|
|
|
+ build-essential git cmake libpcap-dev libjsoncpp-dev wget libssl-dev
|
|
|
+
|
|
|
+WORKDIR /root/build
|
|
|
+
|
|
|
+RUN wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz \
|
|
|
+ && tar xfz boost_1_72_0.tar.gz \
|
|
|
+ && rm boost_1_72_0.tar.gz \
|
|
|
+ && cd boost_1_72_0 \
|
|
|
+ && ./bootstrap.sh --prefix=/usr/local \
|
|
|
+ && ./b2 install \
|
|
|
+ && cd .. \
|
|
|
+ && rm -rf boost_1_72_0
|
|
|
+
|
|
|
+
|
|
|
+RUN git clone https://github.com/mfontanini/libtins.git \
|
|
|
+ && cd libtins && git checkout v4.2 \
|
|
|
+ && mkdir build && cd build \
|
|
|
+ && cmake ../ -DLIBTINS_ENABLE_CXX11=1 && make && make install \
|
|
|
+ && cd ../.. && rm -rf libtins
|
|
|
+
|
|
|
+
|
|
|
+RUN git clone https://github.com/google/googletest.git \
|
|
|
+ && cd googletest \
|
|
|
+ && mkdir build && cd build \
|
|
|
+ && cmake .. && make && make install \
|
|
|
+ && cd ../.. && rm -rf googletest
|
|
|
+
|
|
|
+RUN mkdir /root/build/files \
|
|
|
+ && touch /root/build/config.txt \
|
|
|
+ && echo "port=1234" >> /root/build/config.txt \
|
|
|
+ && echo "interface=lo" >> /root/build/config.txt \
|
|
|
+ && echo "userdatabase=userStorage.txt" >> /root/build/config.txt \
|
|
|
+ && echo "filedirectory=./files" >> /root/build/config.txt
|
|
|
+
|
|
|
+
|
|
|
+COPY .cmake_modules/ /root/.cmake_modules
|
|
|
+COPY /daemon/include /root/build/include
|
|
|
+COPY /daemon/src /root/build/src
|
|
|
+COPY /daemon/test /root/build/test
|
|
|
+COPY /daemon/CMakeLists.txt /root/build
|
|
|
+
|
|
|
+
|
|
|
+RUN cmake -DENABLE_TESTS=true . && make \
|
|
|
+ && rm -rf src include CMakeFiles \
|
|
|
+ && rm Makefile CMakeCache.txt cmake_install.cmake CMakeLists.txt \
|
|
|
+ CTestTestfile.cmake
|
|
|
+
|
|
|
+
|
|
|
+ENTRYPOINT /root/build/bin/ccats
|
|
|
+EXPOSE 1234
|