wt-postgres.dockerfile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. FROM buildpack-deps:xenial
  2. RUN apt-get update -yqq && apt-get install -yqq software-properties-common unzip cmake
  3. RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y
  4. RUN apt-get update -yqq
  5. RUN apt-get install -yqq gcc-6 g++-6
  6. ENV WT_VERSION 4.0.2
  7. ENV BOOST_ROOT /boost
  8. ENV BOOST_INC ${BOOST_ROOT}/include
  9. ENV BOOST_LIB ${BOOST_ROOT}/lib
  10. ENV WT_ROOT /wt
  11. ENV WT_LIB ${WT_ROOT}/lib
  12. ENV WT_INC ${WT_ROOT}/include
  13. ENV LD_LIBRARY_PATH ${BOOST_LIB}:${WT_LIB}:${LD_LIBRARY_PATH}
  14. ENV CPLUS_INCLUDE_PATH /usr/include/postgresql:/usr/include/postgresql/9.3/server:${CPLUS_INCLUDE_PATH}
  15. WORKDIR ${WT_ROOT}
  16. COPY benchmark.cpp benchmark.cpp
  17. COPY fortunes.xml fortunes.xml
  18. COPY wt_config.xml wt_config.xml
  19. # Build boost_thread, boost_system, boost_filesystem and boost_program_options
  20. RUN wget -q https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
  21. RUN tar xf boost_1_65_1.tar.gz
  22. RUN cd boost_1_65_1 && \
  23. ./bootstrap.sh && \
  24. ./b2 \
  25. -d0 \
  26. toolset=gcc-6 \
  27. variant=release \
  28. link=static \
  29. cxxflags="-std=c++14 -march=native" \
  30. cflags="-march=native" \
  31. --prefix=${BOOST_ROOT} \
  32. --with-system \
  33. --with-thread \
  34. --with-program_options \
  35. --with-filesystem \
  36. install
  37. RUN wget -q https://github.com/emweb/wt/archive/${WT_VERSION}.tar.gz
  38. RUN mv ${WT_VERSION}.tar.gz wt-${WT_VERSION}.tar.gz
  39. RUN tar xf wt-${WT_VERSION}.tar.gz
  40. RUN cd wt-$WT_VERSION && \
  41. mkdir -p build && \
  42. cd build && \
  43. cmake .. -DCMAKE_CXX_STANDARD=14 -DCMAKE_BUILD_TYPE=Release \
  44. -DBOOST_PREFIX=${BOOST_ROOT} \
  45. -DCMAKE_INSTALL_PREFIX=${WT_ROOT} -DCONFIGDIR=${WT_ROOT}/etc \
  46. -DCMAKE_C_COMPILER=$(which gcc-6) \
  47. -DCMAKE_CXX_COMPILER=$(which g++-6) -DDESTDIR=${WT_ROOT} \
  48. -DWEBUSER=$(id -u -n) -DWEBGROUP=$(id -g -n) \
  49. -DENABLE_SSL=OFF -DHTTP_WITH_ZLIB=OFF \
  50. -DCMAKE_C_FLAGS_RELEASE="-O3 -march=native -DNDEBUG" \
  51. -DCMAKE_CXX_FLAGS_RELEASE="-O3 -march=native -DNDEBUG" \
  52. -DBUILD_TESTS=OFF -DENABLE_LIBWTTEST=OFF \
  53. -DSHARED_LIBS=OFF >/dev/null && \
  54. make && make install
  55. RUN g++-6 \
  56. -std=c++14 \
  57. -O3 -march=native -DNDEBUG \
  58. -I${BOOST_INC} \
  59. -L${BOOST_LIB} \
  60. -I${WT_INC} \
  61. -L${WT_LIB} \
  62. -o te-benchmark-pg.wt \
  63. -DBENCHMARK_USE_POSTGRES \
  64. benchmark.cpp \
  65. -lwthttp -lwt \
  66. -lwtdbo -lwtdbopostgres \
  67. -lboost_system \
  68. -lboost_program_options \
  69. -lboost_thread \
  70. -lboost_filesystem \
  71. -lpthread \
  72. -lpq
  73. ENV DBHOST tfb-database
  74. CMD ./te-benchmark-pg.wt -c wt_config.xml -t $(nproc) --docroot . --approot . --http-listen 0.0.0.0:8080 --accesslog=- --no-compression