Dockerfile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. FROM centos:centos7.2.1511
  2. RUN yum install -y wget pcre pcre-devel gcc gcc-c++ make zlib-devel sudo openssh-server vim lrzsz openssl-devel &&\
  3. yum install -y crypto-policies snappy-devel psmisc git epel-release jq && \
  4. yum install -y autoconf automake libtool gcc-gfortran bzip2 jq &&\
  5. yum clean all && \
  6. cd /usr/local &&\
  7. wget http://storage.jd.com/lbs-search-acc/gcc-4.9.3.tar.bz2 &&\
  8. tar jxvf gcc-4.9.3.tar.bz2 &&\
  9. cd gcc-4.9.3 &&\
  10. wget http://storage.jd.com/lbs-search-acc/mpfr-2.4.2.tar.bz2 &&\
  11. wget http://storage.jd.com/lbs-search-acc/gmp-4.3.2.tar.bz2 &&\
  12. wget http://storage.jd.com/lbs-search-acc/mpc-0.8.1.tar.gz &&\
  13. wget http://storage.jd.com/lbs-search-acc/isl-0.12.2.tar.bz2 &&\
  14. wget http://storage.jd.com/lbs-search-acc/cloog-0.18.1.tar.gz &&\
  15. wget http://storage.jd.com/lbs-search-acc/download_prerequisites &&\
  16. mv download_prerequisites ./contrib/download_prerequisites &&\
  17. chmod +x ./contrib/download_prerequisites &&\
  18. ./contrib/download_prerequisites &&\
  19. cd .. &&\
  20. mkdir build-gcc &&\
  21. cd build-gcc &&\
  22. ../gcc-4.9.3/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++ --enable-plugin --enable-initfini-array --disable-libgcj --enable-gnu-indirect-function --with-tune=generic --disable-multilib &&\
  23. make -j8 &&\
  24. make install
  25. RUN useradd --create-home --no-log-init --shell /bin/bash isearch && echo "isearch:isearch" | chpasswd && \
  26. mkdir -p /env/app &&\
  27. cd /env/app/ &&\
  28. wget --no-check-certificate https://cmake.org/files/v3.21/cmake-3.21.2.tar.gz &&\
  29. tar xf cmake-3.21.2.tar.gz &&\
  30. cd /env/app/cmake-3.21.2 &&\
  31. ./bootstrap &&\
  32. gmake &&\
  33. gmake install &&\
  34. cd /usr/bin &&\
  35. ln -s cmake3 cmake
  36. RUN cd /usr/local &&\
  37. git clone https://github.com/facebook/rocksdb.git &&\
  38. cd rocksdb &&\
  39. git checkout -b 6.6.0 ad528fe5ca08dafff47d79c85abbf3e1fbb21568 &&\
  40. make shared_lib &&\
  41. ln -s /usr/local/rocksdb/librocksdb.so.6.6.0 /lib64/librocksdb.so.6 &&\
  42. cd /usr/local &&\
  43. git clone https://github.com/gflags/gflags.git &&\
  44. cd gflags &&\
  45. git checkout -b 2.2 v2.2.2 &&\
  46. cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON -DGFLAGS_NAMESPACE=google -G "Unix Makefiles" . &&\
  47. make && make install &&\
  48. ldconfig &&\
  49. ln -s /usr/local/lib/libgflags.so.2.2 /lib64
  50. RUN yum install -y unzip gcc-gfortran && cd /usr/local &&\
  51. wget http://storage.jd.com/lbs-search-acc/protobuf-3.12.2.zip &&\
  52. unzip protobuf-3.12.2.zip &&\
  53. cd protobuf-3.12.2 &&\
  54. ./autogen.sh &&\
  55. ./configure &&\
  56. make -j8 && make install &&\
  57. ln -s /usr/local/lib/libprotobuf.so.23.0.2 /lib64/libprotobuf.so.23 &&\
  58. ln -s /usr/local/lib/libprotoc.so.23.0.2 /lib64/libprotoc.so.23
  59. RUN yum install openblas-devel.x86_64 -y && cd /usr/local &&\
  60. wget http://storage.jd.com/lbs-search-acc/lapack-3.10.0.tar.gz &&\
  61. tar zxvf lapack-3.10.0.tar.gz &&\
  62. cd lapack-3.10.0 &&\
  63. mkdir build &&\
  64. cd build &&\
  65. cmake -DCMAKE_INSTALL_LIBDIR=$HOME/.local/lapack .. &&\
  66. cmake --build . -j --target install &&\
  67. ln -s /usr/local/lapack-3.10.0/build/lib/liblapack.a /lib64/ &&\
  68. cd /usr/local &&\
  69. wget http://storage.jd.com/lbs-search-acc/faiss-main.zip &&\
  70. unzip faiss-main.zip &&\
  71. cd faiss-main &&\
  72. cmake -B build . -DFAISS_ENABLE_GPU=OFF -DFAISS_ENABLE_PYTHON=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DBLA_VENDOR=Generic -DBLAS_LIBRARIES=/lib64/libopenblas.so -DLAPACK_LIBRARIES=/lib64/liblapack.a &&\
  73. cd build/ &&\
  74. make -j8 && make install &&\
  75. ln -s /usr/local/faiss-main/build/faiss/libfaiss.so /lib64/