|
| 1 | +FROM ubuntu:24.04 AS builder |
| 2 | + |
| 3 | +RUN apt-get update && \ |
| 4 | + env DEBIAN_FRONTEND=noninteractive apt-get install -y \ |
| 5 | + build-essential \ |
| 6 | + curl \ |
| 7 | + libcurl4-openssl-dev |
| 8 | + |
| 9 | +WORKDIR /opt/intel |
| 10 | + |
| 11 | +ARG SGX_SDK_URL=https://download.01.org/intel-sgx/sgx-linux/2.26/distro/ubuntu24.04-server/sgx_linux_x64_sdk_2.26.100.0.bin |
| 12 | + |
| 13 | +RUN curl -sSLfO ${SGX_SDK_URL} \ |
| 14 | + && export SGX_SDK_INSTALLER=$(basename $SGX_SDK_URL) \ |
| 15 | + && chmod +x $SGX_SDK_INSTALLER \ |
| 16 | + && echo "yes" | ./$SGX_SDK_INSTALLER \ |
| 17 | + && rm $SGX_SDK_INSTALLER |
| 18 | + |
| 19 | +ARG DCAP_VERSION=DCAP_1.23 |
| 20 | +ARG DCAP_TARBALL_SHA256="c4567e7bc0a2f0dbb70fa2625a9af492e00b96e83d07fa69b9f4f304a9992495" |
| 21 | + |
| 22 | +RUN curl -sSLfO https://github.com/intel/SGXDataCenterAttestationPrimitives/archive/$DCAP_VERSION.tar.gz && \ |
| 23 | + echo "$DCAP_TARBALL_SHA256 $DCAP_VERSION.tar.gz" | sha256sum -c - && \ |
| 24 | + tar xzf $DCAP_VERSION.tar.gz && mv SGXDataCenterAttestationPrimitives* SGXDataCenterAttestationPrimitives |
| 25 | + |
| 26 | +WORKDIR SGXDataCenterAttestationPrimitives/tools/PCKRetrievalTool |
| 27 | + |
| 28 | +RUN sed -e 's:sys/firmware/efi:run:g' -i App/utility.cpp \ |
| 29 | + && make |
| 30 | + |
| 31 | +FROM ubuntu:24.04 |
| 32 | + |
| 33 | +WORKDIR /opt/intel/sgx-pck-id-retrieval-tool/ |
| 34 | +COPY --from=builder /opt/intel/SGXDataCenterAttestationPrimitives/tools/PCKRetrievalTool/PCKIDRetrievalTool . |
| 35 | + |
| 36 | +RUN ln -sf /lib/x86_64-linux-gnu/libsgx_id_enclave.signed.so.1 && \ |
| 37 | + ln -sf /lib/x86_64-linux-gnu/libsgx_pce.signed.so.1 |
| 38 | + |
| 39 | +ARG SGX_SDK_VERSION=2_26_100 |
| 40 | +RUN apt update && apt install -y curl gnupg \ |
| 41 | + && echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu noble main" | \ |
| 42 | + tee -a /etc/apt/sources.list.d/intel-sgx.list \ |
| 43 | + && curl -s https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | \ |
| 44 | + gpg --dearmor --output /usr/share/keyrings/intel-sgx.gpg \ |
| 45 | + && curl -sFLf https://download.01.org/intel-sgx/sgx_repo/ubuntu/apt_preference_files/99sgx_${SGXSDK_VERSION}_noble_custom_version.cfg | \ |
| 46 | + tee -a /etc/apt/preferences.d/99sgx_sdk \ |
| 47 | + && apt update \ |
| 48 | + && apt install -y --no-install-recommends \ |
| 49 | + libcurl4 \ |
| 50 | + tdx-qgs \ |
| 51 | + libsgx-ae-pce \ |
| 52 | + libsgx-ae-id-enclave \ |
| 53 | + libsgx-ra-uefi \ |
| 54 | + libsgx-dcap-default-qpl |
| 55 | + |
| 56 | +# BUG: "qgs -p=0" gets overriden by the config file making the parameter useless |
| 57 | +RUN sed -e 's/\(^port =\).*/\1 0/g' -i /etc/qgs.conf |
| 58 | + |
| 59 | +COPY dcap-registration-flow /usr/bin |
| 60 | + |
| 61 | +ENTRYPOINT ["/opt/intel/tdx-qgs/qgs", "--no-daemon", "-p=0"] |
0 commit comments