Skip to content
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

question: Ability to add features and/or modify feature parameters #265

Open
phorcys420 opened this issue Jul 5, 2024 · 3 comments
Open

Comments

@phorcys420
Copy link
Member

Hello everyone,

I'm looking for a way to add/edit a feature based on input from a coder_parameter.

Use-case is for example asking a user "Do you want to have a desktop ?" and adding the desktop-lite based on that.


Is there anything currently preventing me to do so or is there a flag/env variable I can pass to the CLI ?
I'm currently using my own template based on devcontainer-docker

@matifali
Copy link
Member

matifali commented Jul 5, 2024

one way to do it is to have multiple devcontainer.json files and set the ENVBUILDER_DEVCONTAINER_JSON_PATH and ENVBUILDER_DEVCONTAINER_DIR conditionally. Otherwise, I do not see a dynamic way to edit the devcontainer.json on the fly.

I guess devcontainer-cli also does not support this. (I know devcontainer vscode extension does support adding features interactively)

Can we support this with a coder-envbuilder extension that allows rebuilding the image and adds/removes features (Haven't thought about how it will work yet). cc: @kylecarbs @code-asher

@phorcys420
Copy link
Member Author

one way to do it is to have multiple devcontainer.json files and set the ENVBUILDER_DEVCONTAINER_JSON_PATH and ENVBUILDER_DEVCONTAINER_DIR conditionally. Otherwise, I do not see a dynamic way to edit the devcontainer.json on the fly.

I see, this isn't that great but should work.
I don't really see a better way, I'm pretty much asking for dynamically generating devcontainer.json files from coder_parameters, maybe this is out-of-scope for this project.


Apparently DevContainer Templates are a thing, and "Option Resolution" seems to do part of what I'm looking for.

cc: @matifali

@phorcys420
Copy link
Member Author

Actually, DevContainer Templates are only meant for template administrators bootstrapping their templates, not for end-user customization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants