-
Notifications
You must be signed in to change notification settings - Fork 224
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
Run onCreateCommand and updateContentCommand in prebuilt images (not pre-built Codespaces) #150
Comments
Interesting idea. (Codespaces are not including those commands in the image, but run them to warm-up a VM.) |
DARN! I was about to do a test using I'm so excited by internal features and prebuilds together. Please help me make things easy for our DX teams. |
@metaskills To be clear, devcontainers/spec#60 adds support for Dev Container Features to trigger lifecyle events when the container is created. That allows you to use Features with "pre-built Codespaces" to do this kind of thing just like you can now by just adding that property into devcontainer.json. So - you can do this without Features in pre-built Codespaces today... its just not quite as reusable. But, in all cases, the lifecycle hooks are executed when a container is created (not the image). Pre-built Codespaces are cached fully created containers and source code volumes so, the container already exists. This is raising a broader consideration of some variant of pre-built codespaces that would work locally... which implies some new way of archiving contents or putting everything in the image. @metaskills @andreiborisov Note that devcontainer.json data is in fact stored on the image when you pre-build an image (not a codespace) using the dev container CLI. It won't execute it and store it in the image, but just referencing the image would trigger those events when the container was created. This landed in the last month (its #188), so it's quite new. |
✅ That was very helpful. Of course 🤦♂️ it works that way. I might have to re-consider some of the optimizations I was looking for in diff ways outside of lifecycle hooks. |
Codespaces has an option to bake
onCreateCommand
andupdateContentCommand
steps into the image in case they are time-consuming.Providing a way to create an analog of Codespaces prebuilds would allow the publication of organization-wide fully ready-made images for local use.
The text was updated successfully, but these errors were encountered: