-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
106 lines (90 loc) · 3.23 KB
/
Dockerfile
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
ARG mpspdz_commit=a6cc504
FROM initc3/malicious-shamir-party.x:${mpspdz_commit} as malshamirparty
FROM initc3/mal-shamir-offline.x:${mpspdz_commit} as malshamiroffline
FROM initc3/random-shamir.x:${mpspdz_commit} as randomshamir
FROM initc3/mpspdz:${mpspdz_commit} as mpspdzbase
FROM python:3.9.12-bullseye
ENV PYTHONUNBUFFERED 1
# MP-SPDZ
# TODO: review dependencies as some of them may not be needed.
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libboost-dev \
libboost-thread-dev \
libntl-dev \
libsodium-dev \
libssl-dev \
libtool \
m4 \
texinfo \
yasm \
# ratel
flex \
nodejs \
npm \
# dev
vim \
# tc command, for testing/benchmarking
iproute2 \
# FIXME is this needed?
# Python (HTTP server) dependencies
lsof \
libmpfr-dev \
libmpc-dev \
&& rm -rf /var/lib/apt/lists/*
# mpir
COPY --from=initc3/mpir:55fe6a9 /usr/local/mpir/include/* /usr/local/include/
COPY --from=initc3/mpir:55fe6a9 /usr/local/mpir/lib/* /usr/local/lib/
COPY --from=initc3/mpir:55fe6a9 /usr/local/mpir/share/info/* /usr/local/share/info/
ENV HBSWAP_HOME /usr/src/hbswap
ENV DB_PATH /opt/hbswap/db
ENV INPUTMASK_SHARES "/opt/inputmask-shares"
ENV PREP_DIR "/opt/preprocessing-data"
RUN mkdir -p \
/usr/src/MP-SPDZ \
${HBSWAP_HOME} \
${HBSWAP_HOME}/Persistence \
${DB_PATH} \
${INPUTMASK_SHARES} \
${PREP_DIR}
# malicious-shamir-party.x
COPY --from=malshamirparty \
/usr/local/bin/malicious-shamir-party.x \
/usr/local/bin/malicious-shamir-party.x
COPY --from=malshamirparty /usr/src/MP-SPDZ/libSPDZ.so /usr/src/MP-SPDZ/
RUN cp /usr/local/bin/malicious-shamir-party.x /usr/src/hbswap/
# mal-shamir-offline.x
COPY --from=malshamiroffline \
/usr/local/bin/mal-shamir-offline.x /usr/local/bin/
RUN cp /usr/local/bin/mal-shamir-offline.x /usr/src/hbswap/
# random-shamir.x
COPY --from=randomshamir /usr/local/bin/random-shamir.x /usr/local/bin/
RUN cp /usr/local/bin/random-shamir.x /usr/src/hbswap/
# MP-SPDZ compiler
COPY --from=mpspdzbase /usr/src/MP-SPDZ/compile.py /usr/src/hbswap/
COPY --from=mpspdzbase /usr/src/MP-SPDZ/Compiler /usr/src/hbswap/Compiler
COPY --from=mpspdzbase /usr/src/MP-SPDZ/Programs /usr/src/hbswap/Programs
# ssl keys
COPY --from=mpspdzbase /usr/src/MP-SPDZ/Scripts/setup-ssl.sh /usr/src/hbswap/
# geth
COPY --from=initc3/geth:97745ba /usr/local/bin/geth /usr/local/bin/geth
COPY poa/keystore /opt/poa/keystore
RUN npm install -g [email protected]
RUN pip3 install \
aiohttp \
aiohttp_cors \
web3==5.24.0 \
matplotlib \
gmpy \
gmpy2 \
leveldb \
toml \
fastapi \
pydantic \
uvicorn[standard] \
# dev
ipython \
ipdb
WORKDIR $HBSWAP_HOME
RUN ./setup-ssl.sh 4 /opt/ssl
RUN pip install pybulletproofs