Init Script
If you have a script that needs to be executed repeatedly when running a container, you can use the Init script. The Init script runs from the root directory (/) of the container and is executed when the container starts.
It is commonly used to write scripts that execute your application.
Shell environment limitations
The Init Script is executed using /bin/sh, which has the following limitations:
Only POSIX-compliant
shcommands are supported.Bash-specific syntax (e.g.,
[[ ]],source, arrays, orbashshebangs) cannot be used.Existing scripts written for
bashmust be adapted to be compatible with/bin/sh.
Useful Resources:
POSIX Shell Standard: Official documentation for the standard
/bin/shcommand language.
How to use the Init Script?
You can navigate to the Dashboard page and enter the Container Settings page.
In the Container Settings page, under the Init Script section, you can write the execution commands. Once you're done writing, it will be saved automatically, and these commands will automatically run when the container starts.
Last updated