diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml new file mode 100644 index 00000000..fb67388d --- /dev/null +++ b/.github/workflows/build-docker-images.yml @@ -0,0 +1,29 @@ +# This workflow is used to build docker image for ppid-retrieval-tool + +name: Docker Image CI + +on: + push: + branches: ["master"] + paths: + - "intel-sgx/ppid-retrieval-tool/**" + - ".github/workflows/**" + pull_request: + branches: ["master"] + paths: + - "intel-sgx/ppid-retrieval-tool/**" + - ".github/workflows/**" + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build the Docker image + run: | + cd intel-sgx/ppid-retrieval-tool + docker build -t ppid-retrieval-tool:$(date +%s) . + \ No newline at end of file diff --git a/intel-sgx/ppid-retrieval-tool/Dockerfile b/intel-sgx/ppid-retrieval-tool/Dockerfile new file mode 100644 index 00000000..c0e3489e --- /dev/null +++ b/intel-sgx/ppid-retrieval-tool/Dockerfile @@ -0,0 +1,46 @@ +FROM ubuntu:24.04 AS sgx_sdk + +# Install user +RUN useradd -rm -d /home/ppid-tool -s /bin/bash -g root -G sudo -u 1010 ppid-tool +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN echo 'ppid-tool:ppid-tool' | chpasswd +USER ppid-tool +WORKDIR /home/ppid-tool + +# Install SGX Dev tools +USER root +RUN apt-get update && apt-get upgrade -y && apt-get install -y \ + gnupg \ + wget \ + sudo + +# App build time dependencies +RUN apt-get update +RUN apt-get install -y build-essential + +WORKDIR /opt/intel +RUN wget https://download.01.org/intel-sgx/sgx-linux/2.25/distro/ubuntu24.04-server/sgx_linux_x64_sdk_2.25.100.3.bin +RUN chmod +x sgx_linux_x64_sdk_2.25.100.3.bin +RUN echo 'yes' | ./sgx_linux_x64_sdk_2.25.100.3.bin + +# Install SGX runtime libraries +USER root +RUN echo 'deb [signed-by=/etc/apt/keyrings/intel-sgx-keyring.asc arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu noble main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list +RUN wget https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key +RUN cat intel-sgx-deb.key | sudo tee /etc/apt/keyrings/intel-sgx-keyring.asc > /dev/null +RUN apt-get update +RUN apt-get install -y libsgx-urts + +# Preparing to build PCKIDRetrievalTool +FROM sgx_sdk +USER root + +WORKDIR ppid-tool +COPY Enclave Enclave +COPY pce pce +COPY main.c main.c +COPY Makefile Makefile + +RUN source /opt/intel/sgxsdk/environment && make + +ENTRYPOINT bash \ No newline at end of file diff --git a/intel-sgx/ppid-retrieval-tool/Enclave/ppid.config.xml b/intel-sgx/ppid-retrieval-tool/Enclave/ppid.config.xml index ef3435c3..9b96c358 100644 --- a/intel-sgx/ppid-retrieval-tool/Enclave/ppid.config.xml +++ b/intel-sgx/ppid-retrieval-tool/Enclave/ppid.config.xml @@ -1,6 +1,6 @@ 0 - 0 + 1 0x1 1 1