Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 57a1974

Browse files
committed
Fix: compile Gramine with patch for Python + SSL
See gramineproject/gramine#1694.
1 parent f85d507 commit 57a1974

1 file changed

Lines changed: 63 additions & 7 deletions

File tree

Dockerfile

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1+
FROM ubuntu:22.04 as gramine-build
2+
USER root
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
ENV TS=Etc/UTC
5+
ENV LANG C.UTF-8
6+
ENV LC_ALL C.UTF-8
7+
8+
WORKDIR /root
9+
RUN echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf.d/00-docker
10+
RUN echo 'APT::Install-Recommends "0";' >> /etc/apt/apt.conf.d/00-docker
11+
12+
ARG KERNEL_VERSION=6.2.0-39-generic
13+
14+
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
15+
git \
16+
build-essential \
17+
protobuf-compiler \
18+
libprotobuf-dev \
19+
libprotobuf-c-dev \
20+
protobuf-c-compiler \
21+
autoconf \
22+
bison \
23+
gawk \
24+
nasm \
25+
ninja-build \
26+
meson \
27+
pkg-config \
28+
python3 \
29+
python3-pip \
30+
python3-cryptography \
31+
python3-click \
32+
python3-jinja2 \
33+
python3-protobuf \
34+
python3-pyelftools \
35+
python3-tomli \
36+
python3-tomli-w \
37+
wget \
38+
linux-headers-$KERNEL_VERSION && \
39+
apt-get clean && \
40+
rm -rf /var/lib/apt/lists/*
41+
RUN git clone https://github.com/gramineproject/gramine
42+
RUN cd gramine/ && git checkout 0bea67b7b7c00ce351d8f308268c6a6979996d8c && \
43+
meson setup build/ --buildtype=release \
44+
-Ddirect=enabled \
45+
-Dsgx=enabled \
46+
-Dsgx_driver_include_path=/usr/src/linux-headers-$KERNEL_VERSION/arch/x86/include/uapi && \
47+
ninja -C build/ && \
48+
ninja -C build/ install
49+
150
FROM ubuntu:22.04
251

352
USER root
@@ -16,27 +65,35 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
1665
build-essential \
1766
pkg-config \
1867
curl \
68+
libprotobuf-dev \
69+
libprotobuf-c-dev \
70+
protobuf-c-compiler \
1971
python3 \
2072
python3-pip \
2173
python3-venv \
74+
python3-cryptography \
75+
python3-click \
76+
python3-jinja2 \
77+
python3-protobuf \
78+
python3-pyelftools \
79+
python3-tomli \
80+
python3-tomli-w \
2281
gnupg \
2382
ca-certificates \
2483
curl \
2584
tzdata \
2685
wget && \
2786
rm -rf /var/lib/apt/lists/*
2887

29-
# Gramine APT repository
30-
RUN curl -fsSLo /usr/share/keyrings/gramine-keyring.gpg https://packages.gramineproject.io/gramine-keyring.gpg && \
31-
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/gramine-keyring.gpg] https://packages.gramineproject.io/ jammy main" \
32-
| tee /etc/apt/sources.list.d/gramine.list
88+
COPY --from=gramine-build /usr/local/bin/gramine-* /usr/local/bin/
89+
COPY --from=gramine-build /usr/local/lib/python3.10/dist-packages/graminelibos /usr/local/lib/python3.10/dist-packages/graminelibos
90+
COPY --from=gramine-build /usr/local/lib/x86_64-linux-gnu/gramine/ /usr/local/lib/x86_64-linux-gnu/gramine/
3391

3492
# Intel SGX APT repository
3593
RUN curl -fsSLo /usr/share/keyrings/intel-sgx-deb.asc https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key && \
3694
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx-deb.asc] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main" \
3795
| tee /etc/apt/sources.list.d/intel-sgx.list
3896

39-
4097
# Install Intel SGX dependencies and Gramine
4198
RUN apt-get update && apt-get install -y \
4299
libsgx-launch \
@@ -48,8 +105,7 @@ RUN apt-get update && apt-get install -y \
48105
linux-base-sgx \
49106
libsgx-dcap-default-qpl \
50107
sgx-aesm-service \
51-
libsgx-aesm-quote-ex-plugin \
52-
gramine && \
108+
libsgx-aesm-quote-ex-plugin && \
53109
rm -rf /var/lib/apt/lists/*
54110

55111
WORKDIR /opt/intel

0 commit comments

Comments
 (0)