Skip to content

Commit 44f3eb5

Browse files
committed
Add key-provider build files
1 parent e156d51 commit 44f3eb5

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed

key-provider-build/Dockerfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM gramineproject/gramine:v1.5
2+
3+
# Prevent timezone prompt by setting noninteractive frontend and configuring tzdata
4+
ENV DEBIAN_FRONTEND=noninteractive \
5+
TZ=Etc/UTC \
6+
TZDATA=Etc/UTC \
7+
LC_ALL=en_US.UTF-8 \
8+
LANG=en_US.UTF-8
9+
10+
# Set timezone
11+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
12+
13+
# Install required packages
14+
RUN apt update && apt install -y \
15+
build-essential \
16+
chrpath \
17+
diffstat \
18+
lz4 \
19+
python3 \
20+
locales \
21+
git \
22+
file \
23+
gawk \
24+
wget \
25+
curl \
26+
libclang-dev \
27+
xorriso
28+
29+
# Runtime dependencies
30+
RUN apt-get update && \
31+
DEBIAN_FRONTEND=noninteractive apt-get install -y \
32+
sgx-aesm-service \
33+
libsgx-aesm-launch-plugin \
34+
libsgx-aesm-quote-ex-plugin \
35+
libsgx-aesm-ecdsa-plugin \
36+
libsgx-dcap-quote-verify \
37+
psmisc
38+
39+
# Install Rust
40+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
41+
ENV PATH="/root/.cargo/bin:${PATH}"
42+
43+
RUN git clone https://github.com/MoeMahhouk/gramine-sealing-key-provider.git
44+
45+
WORKDIR /gramine-sealing-key-provider
46+
# Build gramine-sealing-key-provider binary
47+
RUN make target/release/gramine-sealing-key-provider
48+
# Generate private key
49+
RUN gramine-sgx-gen-private-key
50+
# Build gramine manifest
51+
RUN make RUST_LOG=info
52+
53+
COPY entrypoint.sh /entrypoint.sh
54+
RUN chmod +x /entrypoint.sh
55+
ENTRYPOINT ["/entrypoint.sh"]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
gramine-sealing-key-provider:
3+
container_name: gramine-sealing-key-provider
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
privileged: true
8+
devices:
9+
- "/dev/sgx_enclave:/dev/sgx_enclave"
10+
- "/dev/sgx_provision:/dev/sgx_provision"
11+
volumes:
12+
- ./:/workspace
13+
environment:
14+
- SGX=1
15+
ports:
16+
- "3443:3443"

key-provider-build/entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
set -e
3+
AESM_PATH=/opt/intel/sgx-aesm-service/aesm LD_LIBRARY_PATH=/opt/intel/sgx-aesm-service/aesm /opt/intel/sgx-aesm-service/aesm/aesm_service --no-syslog
4+
echo "Starting Gramine Sealing Key Provider"
5+
make SGX=1 run-provider

key-provider-build/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
docker compose up --build

0 commit comments

Comments
 (0)