sgx-sdk-demo: add DCAP Quote Generation sample

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
This commit is contained in:
Mikko Ylinen 2020-09-16 09:55:38 +03:00
parent 2a2993b13c
commit 8677e0e99b

View File

@ -6,7 +6,6 @@ RUN apt-get update && \
apt-get install -y \ apt-get install -y \
wget \ wget \
unzip \ unzip \
curl \
protobuf-compiler \ protobuf-compiler \
libprotobuf-dev \ libprotobuf-dev \
build-essential \ build-essential \
@ -15,6 +14,8 @@ RUN apt-get update && \
gdb \ gdb \
vim \ vim \
python3 \ python3 \
git \
gnupg \
&& apt-get -y -q upgrade \ && apt-get -y -q upgrade \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -23,6 +24,15 @@ RUN apt-get update && \
WORKDIR /opt/intel WORKDIR /opt/intel
ARG SGX_SDK_INSTALLER=sgx_linux_x64_sdk_2.11.100.2.bin ARG SGX_SDK_INSTALLER=sgx_linux_x64_sdk_2.11.100.2.bin
ARG DCAP_VERSION=DCAP_1.8
RUN echo "deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu bionic main" >> /etc/apt/sources.list.d/intel-sgx.list \
&& wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | apt-key add - \
&& apt-get update \
&& apt-get install -y \
libsgx-dcap-ql-dev \
libsgx-dcap-default-qpl-dev \
libsgx-quote-ex-dev
# Install SGX SDK # Install SGX SDK
RUN wget https://download.01.org/intel-sgx/sgx-linux/2.11/distro/ubuntu18.04-server/$SGX_SDK_INSTALLER \ RUN wget https://download.01.org/intel-sgx/sgx-linux/2.11/distro/ubuntu18.04-server/$SGX_SDK_INSTALLER \
@ -30,9 +40,17 @@ RUN wget https://download.01.org/intel-sgx/sgx-linux/2.11/distro/ubuntu18.04-ser
&& echo "yes" | ./$SGX_SDK_INSTALLER \ && echo "yes" | ./$SGX_SDK_INSTALLER \
&& rm $SGX_SDK_INSTALLER && rm $SGX_SDK_INSTALLER
RUN git clone -b $DCAP_VERSION https://github.com/intel/SGXDataCenterAttestationPrimitives.git
RUN cd sgxsdk/SampleCode/SampleEnclave \ RUN cd sgxsdk/SampleCode/SampleEnclave \
&& . /opt/intel/sgxsdk/environment \ && . /opt/intel/sgxsdk/environment \
&& make && make \
&& cd -
RUN cd SGXDataCenterAttestationPrimitives/SampleCode/QuoteGenerationSample \
&& . /opt/intel/sgxsdk/environment \
&& make \
&& cd -
FROM ubuntu:bionic FROM ubuntu:bionic
@ -45,13 +63,19 @@ RUN apt-get update && \
RUN echo "deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu bionic main" >> /etc/apt/sources.list.d/intel-sgx.list \ RUN echo "deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu bionic main" >> /etc/apt/sources.list.d/intel-sgx.list \
&& wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | apt-key add - \ && wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | apt-key add - \
&& apt-get update \ && apt-get update \
&& apt-get install -y libsgx-enclave-common libsgx-urts \ && apt-get install -y \
&& mkdir -p /opt/intel/sgx-sample-app/ libsgx-enclave-common \
libsgx-urts \
libsgx-quote-ex \
libsgx-dcap-ql \
libsgx-dcap-default-qpl \
&& mkdir -p /opt/intel/sgx-sample-app/ \
&& mkdir -p /opt/intel/sgx-quote-generation/
COPY --from=builder /opt/intel/sgxsdk/SampleCode/SampleEnclave/app /opt/intel/sgx-sample-app/sgx-sample-app COPY --from=builder /opt/intel/sgxsdk/SampleCode/SampleEnclave/app /opt/intel/sgx-sample-app/sgx-sample-app
COPY --from=builder /opt/intel/sgxsdk/SampleCode/SampleEnclave/enclave.signed.so /opt/intel/sgx-sample-app/enclave.signed.so COPY --from=builder /opt/intel/sgxsdk/SampleCode/SampleEnclave/enclave.signed.so /opt/intel/sgx-sample-app/enclave.signed.so
COPY --from=builder /opt/intel/sgxsdk/SampleCode/SampleEnclave/enclave.so /opt/intel/sgx-sample-app/enclave.so
WORKDIR /opt/intel/sgx-sample-app/ COPY --from=builder /opt/intel/SGXDataCenterAttestationPrimitives/SampleCode/QuoteGenerationSample/app /opt/intel/sgx-quote-generation/sgx-quote-generation
COPY --from=builder /opt/intel/SGXDataCenterAttestationPrimitives/SampleCode/QuoteGenerationSample/enclave.signed.so /opt/intel/sgx-quote-generation/enclave.signed.so
ENTRYPOINT /opt/intel/sgx-sample-app/sgx-sample-app ENTRYPOINT /opt/intel/sgx-sample-app/sgx-sample-app