Phala Cloud adds this script to your app compose as pre_launch_script. dstack runs it inside the CVM before your containers start. It signs in to private registries with your encrypted variables, deletes unused Docker images and volumes, pulls the latest images, sets the root password and SSH keys, and sets the DSTACK_APP_ID and gateway domain variables. Because it is part of the app compose, your CVM’s compose hash covers it: editing this script produces a new compose hash, which changes MR_CONFIG_ID and the compose-hash event in RTMR3. New CVMs get the version marked below unless you set your own script.
Source: Dstack-TEE/dstack-examples/phala-cloud-prelaunch-script/prelaunch.sh