intel-device-plugins-for-ku.../demo/sgx-sdk-demo/Dockerfile
Mikko Ylinen 0ad7b5b6f9 sgx-sdk-demo: install packages without recommendations
The client side packages Recommends aesmd service and that gets pulled
in the image. aesmd service is expected to run in its own container so
we build the sample apps container without it.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-09-25 13:14:17 +03:00

82 lines
2.7 KiB
Docker

FROM ubuntu:bionic AS builder
WORKDIR /root
RUN apt-get update && \
apt-get install -y \
wget \
unzip \
protobuf-compiler \
libprotobuf-dev \
build-essential \
cmake \
pkg-config \
gdb \
vim \
python3 \
git \
gnupg \
&& apt-get -y -q upgrade \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# SGX SDK is installed in /opt/intel directory.
WORKDIR /opt/intel
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
RUN wget https://download.01.org/intel-sgx/sgx-linux/2.11/distro/ubuntu18.04-server/$SGX_SDK_INSTALLER \
&& chmod +x $SGX_SDK_INSTALLER \
&& echo "yes" | ./$SGX_SDK_INSTALLER \
&& rm $SGX_SDK_INSTALLER
RUN git clone -b $DCAP_VERSION https://github.com/intel/SGXDataCenterAttestationPrimitives.git
RUN cd sgxsdk/SampleCode/SampleEnclave \
&& . /opt/intel/sgxsdk/environment \
&& make \
&& cd -
RUN cd SGXDataCenterAttestationPrimitives/SampleCode/QuoteGenerationSample \
&& . /opt/intel/sgxsdk/environment \
&& make \
&& cd -
FROM ubuntu:bionic
RUN apt-get update && \
apt-get install -y \
wget \
gnupg
# Add 01.org to apt for SGX packages and install SGX runtime components
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 --no-install-recommends \
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/enclave.signed.so /opt/intel/sgx-sample-app/enclave.signed.so
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