Skip to content

Commit 98d7d65

Browse files
authored
Merge pull request #337 from Dstack-TEE/init-script
Add init_script in app-compose.json
2 parents 3425787 + 69785db commit 98d7d65

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

basefiles/dstack-prepare.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,11 @@ mkdir -p $DATA_MNT/var/lib/docker
4545
mount --rbind $DATA_MNT/var/lib/docker /var/lib/docker
4646
mount --rbind $WORK_DIR /dstack
4747
mount_overlay /etc/users $OVERLAY_PERSIST
48+
49+
cd /dstack
50+
51+
if [ $(jq 'has("init_script")' app-compose.json) == true ]; then
52+
echo "Running init script"
53+
dstack-util notify-host -e "boot.progress" -d "init-script" || true
54+
source <(jq -r '.init_script' app-compose.json)
55+
fi

docs/security-guide/cvm-boundaries.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ This is the main configuration file for the application in JSON format:
3939
| allowed_envs | array of string | List of allowed environment variable names |
4040
| no_instance_id | boolean | Disable instance ID generation |
4141
| secure_time | boolean | Whether secure time is enabled |
42-
| pre_launch_script | string | Prelaunch bash script that runs before starting containers |
42+
| pre_launch_script | string | Prelaunch bash script that runs before execute `docker compose up` |
43+
| init_script | string | Bash script that executed prior to dockerd startup |
44+
4345

4446
The hash of this file content is extended to RTMR3 as event name `compose-hash`. Remote verifier can extract the compose-hash during remote attestation.
4547

0 commit comments

Comments
 (0)