Skip to content

Commit

Permalink
add Dockerfile for building SPTAG (#36)
Browse files Browse the repository at this point in the history
* add Dockerfile for building

* add trailing slash in README.md

* add SPTAG to PYTHONPATH

* update cmake comment to be more specific
  • Loading branch information
tekumara authored and MaggieQi committed May 20, 2019
1 parent fe329f0 commit 8eefb3d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ubuntu:18.04

WORKDIR /app
COPY CMakeLists.txt ./
COPY AnnService ./AnnService/
COPY Test ./Test/
COPY Wrappers ./Wrappers/

RUN apt-get update && apt-get -y install wget build-essential libtbb-dev \
# remove the following if you don't want to build the wrappers
openjdk-8-jdk python3-pip swig

# cmake >= 3.12 is required
RUN wget "https://github.com/Kitware/CMake/releases/download/v3.14.4/cmake-3.14.4-Linux-x86_64.tar.gz" -q -O - \
| tar -xz --strip-components=1 -C /usr/local

# specific version of boost
RUN wget "https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz" -q -O - \
| tar -xz && \
cd boost_1_67_0 && \
./bootstrap.sh && \
./b2 install && \
# update ld cache so it finds boost in /usr/local/lib
ldconfig && \
cd .. && rm -rf boost_1_67_0

# build
RUN mkdir build && cd build && cmake .. && make && cd ..

# so python can find the SPTAG module
ENV PYTHONPATH=/app/Release
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ cd build && cmake -A x64 ..
It will generate a SPTAGLib.sln in the build directory.
Compiling the ALL_BUILD project in the Visual Studio (at least 2015) will generate a Release directory which contains all the build targets.

> Using Docker:
```bash
docker build -t sptag .
```
Will build a docker container with binaries in `/app/Release/`

### **Verify**

Run the test (or Test.exe) in the Release folder to verify all the tests have passed.
Expand Down

0 comments on commit 8eefb3d

Please sign in to comment.