Default Development Environment
About 230 wordsLess than 1 minute
The default environment image for cloud-native development is cnbcool/default-dev-env.
Configure Automatic Command Execution
After installing the VS Code extension cnb-welcome, configure the CNB_WELCOME_CMD environment variable to automatically execute commands when the development environment opens.
Tips
The default environment image cnbcool/default-dev-env comes with the cnbcool.cnb-welcome extension pre-installed — no additional installation needed.
Configure in .cnb.yml
Declare a vscode event pipeline in the .cnb.yml of the repository's default branch and set CNB_WELCOME_CMD in env to automatically run the specified command in the terminal when the development environment opens:
$:
vscode:
- services:
- vscode
env:
CNB_WELCOME_CMD: echo "Environment ready, start coding"
stages:
- name: environment created
script: echo "development environment created"The value of CNB_WELCOME_CMD is a shell command that runs once when you enter the development environment (WebIDE / remote client).
Tips
- When
docker.image/docker.buildis not explicitly declared, the development environment uses the default imagecnbcool/default-dev-env. - For multiple steps or special characters, write them into a script file first and set
CNB_WELCOME_CMDto a command that invokes the script, such asbash /workspace/setup.sh.