Dockerfile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. FROM ubuntu:jammy
  2. ENV DEBIAN_FRONTEND=noninteractive DISTR=jammy arch=x86_64
  3. # toolchain stuff
  4. ARG cmakever="3.31.2"
  5. RUN apt-get update && apt-get install -y --no-install-recommends \
  6. curl \
  7. git \
  8. build-essential \
  9. ninja-build \
  10. flex \
  11. bison \
  12. && rm -rf /var/lib/apt/lists/* \
  13. && git config --global --add safe.directory '*' \
  14. && cd / && curl -k -L https://github.com/Kitware/CMake/releases/download/v${cmakever}/cmake-${cmakever}-linux-${arch}.tar.gz | tar -zx
  15. ENV PATH=$PATH:/cmake-${cmakever}-linux-${arch}/bin CTEST_CMAKE_GENERATOR=Ninja CMAKE_GENERATOR=Ninja
  16. # build dependencies
  17. ARG boostminorver=80
  18. RUN apt-get update && apt-get install -y --no-install-recommends \
  19. libmysqlclient-dev \
  20. libexpat-dev \
  21. libpq-dev \
  22. unixodbc-dev \
  23. libjemalloc-dev \
  24. && rm -rf /var/lib/apt/lists/* \
  25. && cd / && curl -k -L https://archives.boost.io/release/1.${boostminorver}.0/source/boost_1_${boostminorver}_0.tar.gz | tar -zx \
  26. && cd boost_1_${boostminorver}_0 \
  27. && ./bootstrap.sh \
  28. && ./b2 install --with-context --with-system --with-filesystem \
  29. && cd - && rm -rf /boost_1_${boostminorver}_0
  30. # llvm
  31. ENV llvm=16
  32. RUN apt-get update && apt-get install -y --no-install-recommends \
  33. gnupg \
  34. ca-certificates \
  35. && curl -k -L https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
  36. && echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-${llvm} main" >> /etc/apt/sources.list.d/llvm.list \
  37. && apt-get update \
  38. && apt-get install -y --no-install-recommends \
  39. clang-$llvm \
  40. && rm -rf /var/lib/apt/lists/*
  41. ENV PATH=$PATH:/usr/lib/llvm-${llvm}/bin CC=/usr/bin/clang-${llvm} CXX=/usr/bin/clang++-${llvm}
  42. # vcpkg
  43. ENV VCPKG_ROOT=/vcpkg VCPKG_DISABLE_METRICS=1 VCPKG_FORCE_SYSTEM_BINARIES=1 PATH=/vcpkg:$PATH
  44. RUN apt-get update && apt-get install -y --no-install-recommends \
  45. curl \
  46. zip \
  47. unzip \
  48. tar \
  49. pkg-config \
  50. && rm -rf /var/lib/apt/lists/* \
  51. && cd / && git clone https://github.com/microsoft/vcpkg.git \
  52. && cd vcpkg \
  53. && ./bootstrap-vcpkg.sh \
  54. && vcpkg install vcpkg-cmake vcpkg-cmake-config vcpkg-cmake-get-vars
  55. # staff for test suite
  56. RUN apt-get update && apt-get install -y --no-install-recommends \
  57. mysql-server \
  58. php \
  59. php-mysql \
  60. php-curl \
  61. php-xml \
  62. python3 \
  63. && rm -rf /var/lib/apt/lists/* \
  64. && mkdir -p /var/run/mysqld \
  65. && { mysqld & } && sleep 5 \
  66. && mysql -e "CREATE USER test@localhost; CREATE DATABASE test; GRANT ALL PRIVILEGES ON test.* TO test@localhost;" \
  67. && mysqladmin shutdown
  68. # latest valgrind via linuxbrew
  69. RUN NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" \
  70. && eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" \
  71. && brew install valgrind \
  72. && ln -s /home/linuxbrew/.linuxbrew/bin/valgrind /usr/bin/ \
  73. && ln -s /home/linuxbrew/.linuxbrew/include/valgrind /usr/include/ \
  74. && apt-get update && apt-get install -y --no-install-recommends \
  75. libc6-dbg \
  76. && rm -rf /var/lib/apt/lists/*
  77. # testing environment
  78. RUN curl -O -k https://repo.manticoresearch.com/manticore-dev-repo.noarch.deb \
  79. && dpkg -i manticore-dev-repo.noarch.deb \
  80. && rm manticore-dev-repo.noarch.deb \
  81. && apt-get update && apt-get install -y --no-install-recommends \
  82. manticore-tzdata \
  83. && rm -rf /var/lib/apt/lists/* \
  84. && cd / && curl -k -L https://dev.mysql.com/get/Downloads/Connector-ODBC/8.3/mysql-connector-odbc-8.3.0-linux-glibc2.28-x86-64bit.tar.gz | tar -zx \
  85. && mkdir -p /aot && cd /aot \
  86. && curl -k -L https://repo.manticoresearch.com/repository/morphology/de.pak.tar.xz | tar -Jx \
  87. && curl -k -L https://repo.manticoresearch.com/repository/morphology/en.pak.tar.xz | tar -Jx \
  88. && curl -k -L https://repo.manticoresearch.com/repository/morphology/ru.pak.tar.xz | tar -Jx
  89. ADD --link sphinx /root/.sphinx
  90. ADD --link entry_point.sh /
  91. VOLUME [ "/work" ]
  92. WORKDIR /work
  93. ENTRYPOINT ["/bin/bash", "/entry_point.sh"]
  94. CMD []
  95. # docker build -t manticore_valgrind:jammy .
  96. # docker image tag manticore_valgrind:jammy manticoresearch/manticore_valgrind:jammy
  97. # docker push manticoresearch/manticore_valgrind:jammy