devcontainers / devcontainers/spec
[proposal] Support more lifecycle scripts
- Dominant language
- No language data
- Stars
- 5.7k
- Forks
- 496
- PR merge metrics
- No merged PRs in 30d
Description
comes from https://github.com/microsoft/vscode-remote-release/issues/8308
Support new container's lifecycle commands.
| Property | Type | Description |
|-------------|--------|-----------------|
| `preDetachCommand` | string,
array,
object | A command to run each time a tool is going to be detached from the container.
Note that the array syntax will execute the command without a shell. You can [learn more](https://github.com/devcontainers/spec/blob/main/docs/specs/devcontainerjson-reference.md#formatting-string-vs-array-properties) about formatting string vs array vs object properties. |
| `postDetachCommand` | string,
array,
object | A command string or list of command arguments to run on the **host machine** after a tool has been detached from the container.
:warning: The command is run wherever the source code is located on the host. For cloud services, this is in the cloud.
Note that the array syntax will execute the command without a shell. You can [learn more](https://github.com/devcontainers/spec/blob/main/docs/specs/devcontainerjson-reference.md#formatting-string-vs-array-properties) about formatting string vs array vs object properties. |
| `preShutdownCommand` | string,
array,
object | A command to run before the container is shutdown.
Note that the array syntax will execute the command without a shell. You can [learn more](https://github.com/devcontainers/spec/blob/main/docs/specs/devcontainerjson-reference.md#formatting-string-vs-array-properties) about formatting string vs array vs object properties. |
| `postShutdownCommand` | string,
array,
object | A command string or list of command arguments to run on the **host machine** after the container is shutdown.
:warning: The command is run wherever the source code is located on the host. For cloud services, this is in the cloud.
Note that the array syntax will execute the command without a shell. You can [learn more](https://github.com/devcontainers/spec/blob/main/docs/specs/devcontainerjson-reference.md#formatting-string-vs-array-properties) about formatting string vs array vs object properties. |
Contributor guide
Assessment
This issue has not been assessed yet.