Dockerfile1128 bytes written ▸text40 lines · 1128 chars
FROM ubuntu:jammy-20260217
ENV DEBIAN_FRONTEND=noninteractive
# System dependencies and build tools
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
wget \
git \
ca-certificates \
build-essential \
cmake \
python3 \
python3-pip \
swig \
libomp-dev \
libopenblas-dev \
libgflags-dev \
&& rm -rf /var/lib/apt/lists/*
# Python dependencies required for the Python bindings and tests
RUN python3 -m pip install numpy==1.26.4 scipy pytest
# Install a newer CMake to satisfy the build system requirements
RUN wget -qO- "https://cmake.org/files/v3.26/cmake-3.26.5-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
# Copy source code
WORKDIR /faiss
COPY . .
# Configure and build Faiss from source (GPU off, tests enabled, Release)
RUN cmake -S . -B build -DFAISS_ENABLE_GPU=OFF -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=Release
RUN cmake --build build -j8
RUN cmake --build build --target swigfaiss
RUN cmake --build build --target install
# Default command: start a shell in the built environment
CMD ["bash"]