Giter Club home page Giter Club logo

Comments (4)

chrmarti avatar chrmarti commented on August 20, 2024 2

Interesting idea. (Codespaces are not including those commands in the image, but run them to warm-up a VM.)

from cli.

Chuxel avatar Chuxel commented on August 20, 2024 1

@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.

from cli.

metaskills avatar metaskills commented on August 20, 2024

DARN! I was about to do a test using onCreateCommand to make our Codespaces prebuilds better by installing package dependencies ahead of time for the developers. Using a hack mentioned here (devcontainers/spec#85 (comment)) but if these are not being run by the CLI because the spec (devcontainers/spec#60) has yet to support it... I'm out of luck for now.

I'm so excited by internal features and prebuilds together. Please help me make things easy for our DX teams.

from cli.

metaskills avatar metaskills commented on August 20, 2024

But, in all cases, the lifecycle hooks are executed when a container is created (not the image).

✅ 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.

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.