-
Notifications
You must be signed in to change notification settings - Fork 40
/
Dockerfile.common.compile.template
40 lines (35 loc) · 1.43 KB
/
Dockerfile.common.compile.template
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
{% if Registry|length %}
FROM {{Registry}}/{{Distro}} AS gramine
{% else %}
FROM {{Distro}} AS gramine
{% endif %}
# Install distro-specific packages to build Gramine (e.g., python3, protobuf, tomli, etc.)
{% block install %}{% endblock %}
RUN git clone {{Gramine.Repository}} /gramine
RUN cd /gramine \
&& git fetch origin {{Gramine.Branch}} \
&& git checkout {{Gramine.Branch}}
{% if "linux-sgx-driver" in SGXDriver.Repository %}
RUN cd /gramine \
&& git clone {{SGXDriver.Repository}} driver \
&& cd driver \
&& git checkout {{SGXDriver.Branch}}
{% else %}
RUN mkdir -p /gramine/driver/asm \
&& cd /gramine/driver/asm \
&& wget --timeout=10 -O sgx.h \
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/arch/x86/include/uapi/asm/sgx.h?h=v5.11 \
&& sha256sum sgx.h | grep -q a34a997ade42b61376b1c5d3d50f839fd28f2253fa047cb9c0e68a1b00477956
{% endif %}
RUN cd /gramine \
&& meson setup build/ --prefix="/gramine/meson_build_output" \
--buildtype={{buildtype}} \
-Ddirect=enabled -Dsgx=enabled \
{% if template_path(Distro).startswith('ubuntu:') %}-Ddcap=enabled{% endif %} \
{% if "linux-sgx-driver" in SGXDriver.Repository %} \
-Dsgx_driver=oot -Dsgx_driver_include_path=/gramine/driver \
{% else %} \
-Dsgx_driver=upstream -Dsgx_driver_include_path=/gramine/driver \
{% endif %} \
&& ninja -C build \
&& ninja -C build install