Commit ad9f3c0 1 parent f080b26 commit ad9f3c0 Copy full SHA for ad9f3c0
File tree 3 files changed +37
-20
lines changed
3 files changed +37
-20
lines changed Original file line number Diff line number Diff line change 1
1
# A local cmake cache will affect the docker image build
2
2
CMakeCache.txt
3
+ # Typical build directory name - if copied in from the host, the image will
4
+ # be very bloated and could interfere with the build process
5
+ build
Original file line number Diff line number Diff line change
1
+ # Dockerized usage
2
+ To create an Ubuntu 18.04-based docker image with HElib and its dependencies
3
+ installed, use the following steps:
4
+
5
+ 1 . Clone HElib and ` cd ` into it.
6
+ 2 . Run ` docker build . ` , optionally tagging with ` -t helib ` or similar. This
7
+ will create an image with HElib installed globally in ` /usr/local ` . Most
8
+ build systems and compilers will look in here. Furthermore, ` cmake ` can be
9
+ used with ` find_package(helib) ` and invoked with no special command-line
10
+ arguments.
11
+ 3 . The image is now ready to be used. Some possibilities include:
12
+ - Create a Dockerfile which begins with ` FROM helib ` , where ` helib ` may be
13
+ any tag you used in step 2, and include your application logic in this
14
+ Dockerfile.
15
+ - Run a container from the HElib docker image directly to experiment, with
16
+ ` docker run -it helib bash `
Original file line number Diff line number Diff line change 1
- FROM alpine:3.8
1
+ FROM ubuntu:18.04
2
2
3
- # Location of the src in the contrainer
4
- ARG helibDir=/helib
5
- # Location of the build in the contrainer
6
- ARG buildDir=/build
3
+ COPY ./ /root/HElib/
7
4
8
- COPY . ${helibDir}
9
-
10
- # Currently fails when cmake is invoked
11
- RUN apk add --update \
12
- g++ \
13
- make \
14
- cmake \
15
- libtool \
16
- && rm -rf /var/cache/apk/* \
17
- && mkdir ${buildDir} \
18
- && cd ${buildDir} \
19
- && cmake ${helibDir} \
20
- && make
21
-
22
- CMD [ "" ]
5
+ RUN apt update && \
6
+ apt install -y build-essential wget cmake m4 libgmp-dev file && \
7
+ cd ~ && \
8
+ wget https://www.shoup.net/ntl/ntl-11.3.2.tar.gz && \
9
+ tar xf ntl-11.3.2.tar.gz && \
10
+ cd ntl-11.3.2/src && \
11
+ ./configure SHARED=on NTL_GMP_LIP=on NTL_THREADS=on NTL_THREAD_BOOST=on && \
12
+ make -j4 && \
13
+ make install && \
14
+ cd ~ && \
15
+ mkdir HElib/build && \
16
+ cd HElib/build && \
17
+ cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED=ON -DENABLE_THREADS=ON .. && \
18
+ make -j4 && \
19
+ make install && \
20
+ ldconfig
23
21
You can’t perform that action at this time.
0 commit comments