devcontainers / devcontainers/cli
Support updating lifecycle scripts on existing containers
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 457
- Avg merge
- 13h 17m
- Merged PRs (30d)
- 6
Description
Because the container configuration is cached in the container labels after creation, any changes to the local config file are ignored for future operations on the container.
In the case of the lifecycle scripts (`onCreateCommand`, `postCreateCommand`, ...) it would be useful in cases of pooling container if changes to the config would be honored so that the container doesn't need to be recreated.
For example, if a container is created with an empty configuration for a pool, then we should be able to later change the configuration to and re-apply the post-creation lifecycle logic against the existing container.
```json
{
"postCreateCommand": "touch foo"
}
```
It would also be useful if the cli could detect the case of a configuration collision and fail with a reasonable message. For example, if the container is created with a `postCreateCommand` already and then the value is changed, then this re-application logic should fail.
Contributor guide
Research direction
Start by tracing how the CLI reads cached container labels and applies lifecycle scripts during operations on existing containers. Verify the behavior for adding a script to an existing container and for changing an existing script; done means compatible changes are reapplied without recreation and collisions fail with a clear message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100