forked from IBM/fhe-toolkit-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.FEDORA.HElib
93 lines (73 loc) · 2.65 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
ARG PlatformRelease
FROM $PlatformRelease
ENV container docker
LABEL maintainer="Flavio Bergamaschi <[email protected]>"
ARG USER_ID
# Docker Container for FEDORA HElib Base
USER root
# Update the base OS
RUN yum -y update
RUN yum clean packages
#Install the Doxygen Dependency so we can make docs
RUN yum -y install doxygen
# 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
# Install bats-core
RUN git clone https://github.com/bats-core/bats-core.git && \
cd bats-core && \
./install.sh /usr/local
# 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 NTL_RANDOM_AES256CTR=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
#Generate the docs of HElib from their source
WORKDIR /opt/IBM/FHE-distro/HElib/documentation
RUN doxygen Doxyfile
# Build and install ML-HElib as system library in /usr/local
COPY ./DEPENDENCIES/ML-HElib /opt/IBM/FHE-distro/ML-HElib
WORKDIR /opt/IBM/FHE-distro/ML-HElib
RUN /bin/bash ./install_system_wide.sh && \
ldconfig
#Generate the docs of ML-HElib from their source
WORKDIR /opt/IBM/FHE-distro/ML-HElib/documentation
RUN doxygen Doxyfile
# Create user fhe:fhe with no login,
RUN adduser --uid ${USER_ID} --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"]