Dockerfile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # INSTRUCTIONS:
  2. # I was not able to build docker images on an isolated devserver because of
  3. # issues with proxy internet access. Use a public cloud or other Linux system.
  4. # (I used a Debian system after installing docker features, adding my user to
  5. # the docker and docker-registry groups, and logging out and back in to pick
  6. # those up.)
  7. #
  8. # Follow https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic
  9. # to login with your GitHub credentials, as in
  10. #
  11. # $ docker login ghcr.io -u pdillinger
  12. #
  13. # and paste the limited-purpose GitHub token into the terminal.
  14. #
  15. # Then in the build_tools/ubuntu24_image directory, (bump minor version for
  16. # random docker file updates, major version tracks Ubuntu release)
  17. #
  18. # $ docker build -t ghcr.io/facebook/rocksdb_ubuntu:24.0
  19. # $ docker push ghcr.io/facebook/rocksdb_ubuntu:24.0
  20. #
  21. # Might need to change visibility to public through
  22. # https://github.com/orgs/facebook/packages/container/rocksdb_ubuntu/settings
  23. # or similar.
  24. # from official ubuntu 24.04
  25. FROM ubuntu:24.04
  26. # update system
  27. RUN apt-get update
  28. RUN apt-get upgrade -y
  29. # install basic tools
  30. RUN apt-get install -y vim wget curl
  31. # install tzdata noninteractive
  32. RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
  33. # install git and default compilers
  34. RUN apt-get install -y git gcc g++ clang clang-tools
  35. # install basic package
  36. RUN apt-get install -y lsb-release software-properties-common gnupg
  37. # install gflags, tbb
  38. RUN apt-get install -y libgflags-dev libtbb-dev
  39. # install compression libs
  40. RUN apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
  41. # install cmake
  42. RUN apt-get install -y cmake
  43. RUN apt-get install -y libssl-dev
  44. # install gcc-12 and more, default is 13
  45. RUN apt-get install -y gcc-12 g++-12 gcc-14 g++-14
  46. # install apt-get install -y valgrind
  47. RUN apt-get install -y valgrind
  48. # install folly depencencies
  49. RUN apt-get install -y libgoogle-glog-dev
  50. # install openjdk 8
  51. RUN apt-get install -y openjdk-8-jdk
  52. ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-amd64
  53. # install mingw
  54. RUN apt-get install -y mingw-w64
  55. # install gtest-parallel package
  56. RUN git clone --single-branch --branch master --depth 1 https://github.com/google/gtest-parallel.git ~/gtest-parallel
  57. ENV PATH $PATH:/root/gtest-parallel
  58. # install libprotobuf for fuzzers test
  59. RUN apt-get install -y ninja-build binutils liblzma-dev libz-dev pkg-config autoconf libtool
  60. RUN git clone --branch v1.0 https://github.com/google/libprotobuf-mutator.git ~/libprotobuf-mutator && cd ~/libprotobuf-mutator && git checkout ffd86a32874e5c08a143019aad1aaf0907294c9f && mkdir build && cd build && cmake .. -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON && ninja && ninja install
  61. ENV PKG_CONFIG_PATH /usr/local/OFF/:/root/libprotobuf-mutator/build/external.protobuf/lib/pkgconfig/
  62. ENV PROTOC_BIN /root/libprotobuf-mutator/build/external.protobuf/bin/protoc
  63. # install the latest google benchmark
  64. RUN git clone --depth 1 --branch v1.7.0 https://github.com/google/benchmark.git ~/benchmark && cd ~/benchmark && mkdir build && cd build && cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DBENCHMARK_ENABLE_GTEST_TESTS=0 && ninja && ninja install && cd ~ && rm -rf /root/benchmark
  65. # clean up
  66. RUN rm -rf /var/lib/apt/lists/*