Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update java-simple example #231

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Examples/java-simple/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:11
FROM openjdk:21-jdk-slim

COPY JavaExample.java .

Expand Down
20 changes: 9 additions & 11 deletions Examples/java-simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,35 @@ using GSC. For more information on Java, please visit https://www.oracle.com/jav
* Tested on:
- Type: Azure Confidential Computing SGX Virtual Machine
- Size: Standard DC1s v3 (1 vCPU, 8 GiB memory)
- OS: Linux (Ubuntu 20.04)
- OpenJDK 11
- OS: Linux (Ubuntu 24.04)
- OpenJDK 21

## Build and run graminized Docker image

1. Build Docker image:

```bash
$ docker build -t openjdk-11-java-simple .
docker build -t openjdk-21-java-simple .
```

2. Graminize the Docker image (this step can take some time!):

```bash
$ (cd ../.. && ./gsc build openjdk-11-java-simple \
Examples/java-simple/java-simple.manifest \
-c <PATH-TO-CONFIG-FILE>)
(cd ../.. && ./gsc build openjdk-21-java-simple \
Examples/java-simple/java-simple.manifest)
```

3. Sign the graminized Docker image:

```bash
$ (cd ../.. && ./gsc sign-image openjdk-11-java-simple \
<PATH-TO-KEY-FILE> \
-c <PATH-TO-CONFIG-FILE>)
(cd ../.. && ./gsc sign-image openjdk-21-java-simple \
<PATH-TO-KEY-FILE>)
```

4. Run graminized image:

```bash
$ docker run --rm --device=/dev/sgx_enclave \
docker run --rm --device=/dev/sgx_enclave \
-v /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket \
gsc-openjdk-11-java-simple
gsc-openjdk-21-java-simple
```