libsniper.dockerfile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. FROM ubuntu:20.04
  2. MAINTAINER [email protected]
  3. ENV DEBIAN_FRONTEND noninteractive
  4. RUN apt-get -qq -y update
  5. RUN apt-get -qq -y install --no-install-recommends git cmake libev-dev libgoogle-perftools-dev libfmt-dev make gcc-9 g++-9 libre2-dev libboost-stacktrace-dev libhttp-parser-dev libxxhash-dev
  6. RUN update-alternatives --quiet --remove-all gcc \
  7. ; update-alternatives --quiet --remove-all g++ \
  8. ; update-alternatives --quiet --remove-all cc \
  9. ; update-alternatives --quiet --remove-all cpp \
  10. ; update-alternatives --quiet --install /usr/bin/gcc gcc /usr/bin/gcc-9 20 \
  11. ; update-alternatives --quiet --install /usr/bin/cc cc /usr/bin/gcc-9 20 \
  12. ; update-alternatives --quiet --install /usr/bin/g++ g++ /usr/bin/g++-9 20 \
  13. ; update-alternatives --quiet --install /usr/bin/cpp cpp /usr/bin/g++-9 20 \
  14. ; update-alternatives --quiet --config gcc \
  15. ; update-alternatives --quiet --config cc \
  16. ; update-alternatives --quiet --config g++ \
  17. ; update-alternatives --quiet --config cpp
  18. COPY ./libsniper_bench /libsniper_bench
  19. WORKDIR /libsniper_bench
  20. RUN git config --global http.sslverify false
  21. ENV LIBSNIPER_VER v1.3.1
  22. RUN git clone https://github.com/rtbtech/libsniper.git libs/core
  23. RUN cd libs/core && git checkout v1.3.1
  24. RUN mkdir build && cd /libsniper_bench/build && cmake -DCMAKE_BUILD_TYPE=Release -S .. && make --jobs=`nproc`
  25. ARG BENCHMARK_ENV
  26. EXPOSE 8090
  27. CMD ./build/bin/libsniper_bench