ubuntu.Dockerfile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. FROM ubuntu:18.04
  2. RUN echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main" >> /etc/apt/sources.list &&\
  3. echo "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe" >> /etc/apt/sources.list &&\
  4. apt update &&\
  5. apt install -y git wget curl psmisc zlib1g-dev libsnappy-dev openssl libssl-dev autoconf automake libtool curl make unzip liblapack-dev libopenblas-dev jq
  6. RUN ln -s /usr/lib/x86_64-linux-gnu/liblapack.a /lib64/ &&\
  7. ln -s /usr/lib/x86_64-linux-gnu/libopenblas.so /lib64/ &&\
  8. apt install gcc-4.9 g++-4.9 -y &&\
  9. update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 20 &&\
  10. update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 20 &&\
  11. cd /usr/local &&\
  12. wget --no-check-certificate https://cmake.org/files/v3.21/cmake-3.21.2.tar.gz &&\
  13. tar zxvf cmake-3.21.2.tar.gz &&\
  14. cd cmake-3.21.2 &&\
  15. ./bootstrap &&\
  16. make -j8 && make install &&\
  17. cd /usr/local &&\
  18. git clone https://github.com/gflags/gflags.git &&\
  19. cd gflags &&\
  20. git checkout -b 2.2 v2.2.2 &&\
  21. cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON -DGFLAGS_NAMESPACE=google -G "Unix Makefiles" . && make && make install &&\
  22. cd /usr/local &&\
  23. git clone https://github.com/facebook/rocksdb.git &&\
  24. cd rocksdb/ &&\
  25. git checkout -b 6.6.0 ad528fe5ca08dafff47d79c85abbf3e1fbb21568 && make -j8 shared_lib &&\
  26. cp /usr/local/rocksdb/librocksdb.so.6.6.0 /usr/lib/librocksdb.so.6 &&\
  27. cd /usr/local &&\
  28. wget http://storage.jd.com/lbs-search-acc/protobuf-3.12.2.zip &&\
  29. unzip protobuf-3.12.2.zip &&\
  30. cd protobuf-3.12.2 &&\
  31. ./autogen.sh &&\
  32. ./configure &&\
  33. make -j8 && make install &&\
  34. ln -s /usr/local/lib/libprotobuf.so.23.0.2 /lib64/ &&\
  35. ln -s /usr/local/lib/libprotoc.so.23.0.2 /lib64/ &&\
  36. cd /usr/local &&\
  37. wget http://storage.jd.com/lbs-search-acc/faiss-main.zip &&\
  38. unzip faiss-main.zip &&\
  39. cd faiss-main &&\
  40. 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 &&\
  41. cd build/ && make -j8 && make install &&\
  42. /bin/rm -rf /usr/local/protobuf-3.12.2 &&\
  43. /bin/rm -rf /usr/local/rocksdb &&\
  44. /bin/rm -rf /usr/local/cmake-3.21.2