forked from IBM/fhe-toolkit-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.FEDORA.HElib
78 lines (60 loc) · 2.2 KB
/
Dockerfile.FEDORA.HElib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
ARG PlatformRelease
FROM $PlatformRelease
ENV container docker
LABEL maintainer="Flavio Bergamaschi <flavio@uk.ibm.com>"
# Docker Container for FEDORA HElib Base
USER root
# Update the base OS
RUN yum -y update
RUN yum clean packages
# Install the compilation toolchain and additional packages we need..
RUN yum -y install autoconf xz curl wget tar cmake git gcc gcc-c++ make diffutils file patchelf vim
RUN yum clean packages
# Install GMP dependency
RUN yum -y install gmp-devel
RUN yum clean packages
# Install IBM Fully Homomorphic Encryption Library for ML Dependency
RUN yum -y install hdf5-devel
RUN yum clean packages
# Create dependencies build environment.
RUN mkdir -p /opt/IBM/FHE-distro
# Download, build and install NTL as system library in /usr/local
COPY ./DEPENDENCIES/NTL /opt/IBM/FHE-distro/NTL
WORKDIR /opt/IBM/FHE-distro/NTL
RUN cd ./src && \
./configure SHARED=on NTL_GMP_LIP=on NTL_THREADS=on NTL_THREAD_BOOST=on && \
make -j4 && \
make install && \
ldconfig && \
cd ../.. && \
rm -rf NTL
# Download, build and install HElib as system library in /usr/local
COPY ./DEPENDENCIES/HElib /opt/IBM/FHE-distro/HElib
WORKDIR /opt/IBM/FHE-distro/HElib
RUN mkdir ./build && \
cd ./build && \
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED=ON -DENABLE_THREADS=ON .. && \
make -j4 && \
make install && \
ldconfig
# Download, build and install Boost as system library in /usr/local
COPY ./DEPENDENCIES/boost /opt/IBM/FHE-distro/boost
WORKDIR /opt/IBM/FHE-distro/boost
RUN ./bootstrap.sh --with-libraries=filesystem,system,thread && \
./b2 -d0 -j4 install && \
ldconfig && \
cd .. && \
rm -rf boost
# Build and install simple_ml_helib as system library in /usr/local
COPY ./DEPENDENCIES/simple_ml_helib /opt/IBM/FHE-distro/simple_ml_helib
WORKDIR /opt/IBM/FHE-distro/simple_ml_helib
RUN /bin/bash ./install_system_wide.sh && \
ldconfig
# Create user fhe:fhe with no login,
RUN adduser --uid 5000 --comment "FHE Toolkit User" fhe
RUN usermod -L fhe
WORKDIR /home/fhe
USER fhe
RUN mkdir -p /home/fhe/FHE_Examples
RUN cp -pr /opt/IBM/FHE-distro/HElib/examples/. /home/fhe/FHE_Examples
CMD ["/usr/bin/bash"]