-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Features contribute lifecycle hooks #390
Conversation
…spicer/features-lifecycles-hooks
….com/devcontainers/cli into joshspicer/features-lifecycles-hooks
…spicer/features-lifecycles-hooks
…g 'up' Logs like 'Running the postCreateCommand from devcontainer.json' are updated to include the origin of the command e.g: 'Running the postCreateCommand from Feature 'common-utils'. This patch adds in a mapping object that is passed along and used to map a command to an origin. This change is a bit less efficient, with the added benefit of not needing to modify the existing merging logic.
…o /opt/build-features This is to support resuming a container in Codespaces with Feature-contributed lifecycle hooks. Codespaces bind-mounts a different volume on top of /tmp, so the container's /tmp directory is not persisted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, left some comments!
src/test/container-features/configs/lifecycle-hooks-advanced/.devcontainer/Dockerfile
Show resolved
Hide resolved
...iner-features/configs/lifecycle-hooks-advanced/.devcontainer/otter/devcontainer-feature.json
Outdated
Show resolved
Hide resolved
233d4df
to
6687ad4
Compare
Validating that publishing Features with lifecycle hook commands function as expected: Note that:
With the file structure: Stopping the container and using the CLIs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, left one comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should agree on how we want to include the origin of the lifecycle hooks as part of devcontainers/spec#206. IMO we can still merge the work here since it only affects the mergedConfiguration
which does not need to adhere to a schema in the specification yet. 👍
With CLI v0.32.0 and devcontainers/cli#390, devcontainer-feature.json now support lifecycle hooks. Spec proposal: https://github.com/devcontainers/spec/blob/b1d19a5375f667a1bb91e86311bc37c36312996b/proposals/features-contribute-lifecycle-scripts.md
* Add lifecycle hooks to devContainerFeature schema With CLI v0.32.0 and devcontainers/cli#390, devcontainer-feature.json now support lifecycle hooks. Spec proposal: https://github.com/devcontainers/spec/blob/b1d19a5375f667a1bb91e86311bc37c36312996b/proposals/features-contribute-lifecycle-scripts.md * Description for providing an option to lifecycle hook
This change implements:
https://github.com/devcontainers/spec/blob/b1d19a5375f667a1bb91e86311bc37c36312996b/proposals/features-contribute-lifecycle-scripts.md
The new contents of the imageMetadata (generated from the
lifecycle-hooks-advanced
) test can be seen below: