Skip to content

Commit

Permalink
Merge pull request #655 from fortanix/ns/RTE-108
Browse files Browse the repository at this point in the history
Dockerfile for PPID retrieval tool
  • Loading branch information
nshyrei authored Nov 21, 2024
2 parents 6dafc6c + d7b80cd commit a6c2241
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/build-docker-images.yml
Original file line number Diff line number Diff line change
@@ -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) .
46 changes: 46 additions & 0 deletions intel-sgx/ppid-retrieval-tool/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion intel-sgx/ppid-retrieval-tool/Enclave/ppid.config.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<EnclaveConfiguration>
<IntelSigned>0</IntelSigned>
<ProvisionKey>0</ProvisionKey>
<ProvisionKey>1</ProvisionKey>
<ProdID>0x1</ProdID>
<ISVSVN>1</ISVSVN>
<TCSNum>1</TCSNum>
Expand Down

0 comments on commit a6c2241

Please sign in to comment.