devcontainers / devcontainers/spec

[proposal] Support more lifecycle scripts

Open
#229 10 comments 5 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.