forked from primihub/primihub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.local
45 lines (37 loc) · 1.47 KB
/
Dockerfile.local
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
# Call this Dockerfile via the build_local.sh script
FROM ubuntu:20.04
ENV LANG c.UTF-8
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1
RUN apt-get update \
&& apt-get install -y python3 python3-dev libgmp-dev python3-pip libzmq5 tzdata libmysqlclient-dev \
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& rm -rf /var/lib/apt/lists/*
ARG TARGET_PATH=/root/.cache/bazel/_bazel_root/17a1cd4fb136f9bc7469e0db6305b35a/execroot/__main__/bazel-out/k8-fastbuild/bin
WORKDIR $TARGET_PATH
# Copy binaries to TARGET_PATH
COPY . ./
# Copy test data files to /tmp/
COPY ./data/ /tmp/
# Change WorkDir to /app
WORKDIR /app
# Make symlink to primihub-node & primihub-cli
RUN mkdir log \
&& ln -s $TARGET_PATH/node /app/primihub-node && ln -s $TARGET_PATH/cli /app/primihub-cli
COPY ./example ./example
# Copy all test config files to /app
COPY ./config ./config
# Copy primihub python sources to /app and setup to system python3
COPY ./python ./python
COPY ./src/primihub/protos/ ./src/primihub/protos/
RUN cp $TARGET_PATH/src/primihub/pybind_warpper/opt_paillier_c2py.so /app/python/
RUN cp $TARGET_PATH/src/primihub/pybind_warpper/linkcontext.so /app/python/
WORKDIR /app/python
RUN python3 -m pip install --upgrade pip \
&& python3 -m pip install -r requirements.txt -i https://pypi.douban.com/simple/ \
&& python3 setup.py develop \
&& rm -rf /root/.cache/pip/
WORKDIR /app
# ENV PYTHONPATH=/usr/lib/python3.9/site-packages/:$TARGET_PATH
# gRPC server port
EXPOSE 50050