Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Use the official Ubuntu base image
  2. FROM ubuntu:22.04
  3. # Set environment variables to non-interactive (this prevents some prompts)
  4. ENV DEBIAN_FRONTEND=noninteractive
  5. # Install necessary dependencies for OpenFHE and JupyterLab
  6. RUN apt-get update && apt-get install -y \
  7. git \
  8. cmake \
  9. build-essential \
  10. python3 \
  11. python3-dev \
  12. python3-pip \
  13. python3-venv \
  14. sudo \
  15. && apt-get clean && rm -rf /var/lib/apt/lists/*
  16. # Install PyBind11
  17. RUN pip3 install "pybind11[global]"
  18. # Install JupyterLab
  19. RUN python3 -m pip install --no-cache-dir jupyterlab
  20. # Clone and build OpenFHE-development
  21. RUN git clone https://github.com/openfheorg/openfhe-development.git \
  22. && cd openfhe-development \
  23. && mkdir build \
  24. && cd build \
  25. && cmake -DBUILD_UNITTESTS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARKS=OFF .. \
  26. && make -j$(nproc) \
  27. && make install
  28. # Assume that OpenFHE installs libraries into /usr/local/lib
  29. # Update LD_LIBRARY_PATH to include this directory
  30. ENV LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
  31. # Clone and build OpenFHE-Python
  32. RUN git clone https://github.com/openfheorg/openfhe-python.git \
  33. && cd openfhe-python \
  34. && mkdir build \
  35. && cd build \
  36. && cmake .. \
  37. && make -j$(nproc) \
  38. && make install
  39. # Expose the port JupyterLab will listen on
  40. EXPOSE 8888
  41. # Set the working directory
  42. WORKDIR /workspace
  43. # Start JupyterLab without token authentication
  44. CMD ["jupyter-lab", "--ip=0.0.0.0", "--no-browser", "--allow-root", "--NotebookApp.token=''", "--NotebookApp.allow_origin='*'", "--NotebookApp.password=''", "--NotebookApp.password_required=False"]