-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (46 loc) · 2.13 KB
/
Dockerfile
File metadata and controls
64 lines (46 loc) · 2.13 KB
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
# **************** BUILD STAGE ********************#
FROM ubuntu:22.04 AS builder
ARG SDK_VERSION=2.25
ARG SGX_VERSION=2.25.100.3
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
gpg \
ca-certificates \
build-essential \
make \
pkg-config
RUN curl -fsSL https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | gpg --dearmor -o /usr/share/keyrings/intel-sgx-deb.gpg \
&& echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx-deb.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | tee /etc/apt/sources.list.d/intel-sgx.list \
&& apt-get update
RUN apt-get install -y --no-install-recommends libsgx-dcap-ql-dev libsgx-dcap-quote-verify-dev
ADD https://download.01.org/intel-sgx/sgx-linux/${SDK_VERSION}/distro/ubuntu22.04-server/sgx_linux_x64_sdk_${SGX_VERSION}.bin ./sgx/
RUN chmod +x ./sgx/sgx_linux_x64_sdk_${SGX_VERSION}.bin
RUN echo -e 'no\n/opt' | ./sgx/sgx_linux_x64_sdk_${SGX_VERSION}.bin && \
rm -rf ./sgx/*
ENV LD_LIBRARY_PATH=/opt/sgxsdk/libsgx-enclave-common/
WORKDIR /app
COPY . .
RUN . /opt/sgxsdk/environment && make
# **************** FINAL STAGE ********************#
FROM ubuntu:22.04 AS attester
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
gpg \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | gpg --dearmor -o /usr/share/keyrings/intel-sgx-deb.gpg \
&& echo 'deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx-deb.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main' | tee /etc/apt/sources.list.d/intel-sgx.list \
&& apt-get update
RUN apt-get install -y --no-install-recommends \
libsgx-dcap-ql \
libsgx-dcap-quote-verify \
libsgx-uae-service \
libsgx-dcap-default-qpl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY sgx_default_qcnl.conf /etc/sgx_default_qcnl.conf
COPY --from=builder /app/app attester
COPY --from=builder /app/enclave.signed.so enclave.signed.so
ENTRYPOINT ["./attester"]