forked from Cosmian/mse-docker-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
93 lines (79 loc) · 2.81 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
FROM ubuntu:22.04
USER root
ENV DEBIAN_FRONTEND=noninteractive
ENV TS=Etc/UTC
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONPYCACHEPREFIX "/tmp"
ENV PYTHONUNBUFFERED 1
RUN echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf.d/00-docker
RUN echo 'APT::Install-Recommends "0";' >> /etc/apt/apt.conf.d/00-docker
RUN apt-get update && apt-get install -y \
git \
build-essential \
pkg-config \
curl \
python3 \
python3-pip \
python3-venv \
gnupg \
ca-certificates \
curl \
tzdata \
wget && \
rm -rf /var/lib/apt/lists/*
# Gramine APT repository
RUN curl -fsSLo /usr/share/keyrings/gramine-keyring.gpg https://packages.gramineproject.io/gramine-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/gramine-keyring.gpg] https://packages.gramineproject.io/ jammy main" \
| tee /etc/apt/sources.list.d/gramine.list
# Intel SGX APT repository
RUN curl -fsSLo /usr/share/keyrings/intel-sgx-deb.asc https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx-deb.asc] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main" \
| tee /etc/apt/sources.list.d/intel-sgx.list
# Install Intel SGX dependencies and Gramine
RUN apt-get update && apt-get install -y \
libsgx-launch \
libsgx-urts \
libsgx-quote-ex \
libsgx-epid \
libsgx-dcap-ql \
libsgx-dcap-quote-verify \
linux-base-sgx \
libsgx-dcap-default-qpl \
sgx-aesm-service \
libsgx-aesm-quote-ex-plugin \
gramine && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/intel
ARG SGX_SDK_VERSION=2.19
ARG SGX_SDK_INSTALLER=sgx_linux_x64_sdk_2.19.100.3.bin
# Install Intel SGX SDK
RUN curl -fsSLo $SGX_SDK_INSTALLER https://download.01.org/intel-sgx/sgx-linux/$SGX_SDK_VERSION/distro/ubuntu22.04-server/$SGX_SDK_INSTALLER \
&& chmod +x $SGX_SDK_INSTALLER \
&& echo "yes" | ./$SGX_SDK_INSTALLER \
&& rm $SGX_SDK_INSTALLER
# Configure virtualenv
ENV GRAMINE_VENV=/opt/venv
RUN python3 -m venv $GRAMINE_VENV
# Install MSE Enclave library
RUN . "$GRAMINE_VENV/bin/activate" && \
python3 -m pip install -U pip setuptools && \
python3 -m pip install -U mse-lib-sgx==2.2
WORKDIR /root
COPY Makefile .
COPY python.manifest.template .
COPY mse-run.sh /usr/local/bin/mse-run
COPY mse-test.sh /usr/local/bin/mse-test
COPY mse-memory.py /usr/local/bin/mse-memory
RUN . /opt/venv/bin/activate && \
pip3 install "flask[async]==2.2.2" \
"Werkzeug==2.2.2" \
"Flask-Cors==3.0.10" \
"torch==1.11.0" \
"tokenizers==0.13.3" \
"transformers==4.16.2" \
"numpy==1.21.6" \
"pandas==1.3.5" \
"pycryptodome==3.17" \
"cosmian-kms==4.8.2"