Allow choosing a remote devcontainer for a repository. #57953
-
Select Topic AreaProduct Feedback BodyI use devcontainers a lot. GitHub Codespaces has allowed me to efficiently work remotely, and I can easily contribute to OSS, work on private projects, and collaborate with my team while on the go. However, when people don't have a devcontainer in their repository (in most cases, when the repository only requires one already consistent tool, like Deno), these tools aren't supported by default by Codespaces's default devcontainer. This means you're left with three options:
To alleviate this issue, I think you should be able to choose a |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
I've never done this before, but you could also create a template repo for a codespace (e.g. USER/codespace-deno), select "use this template" ➡️ "open in a codespace", and then clone their repo to work on it, right? |
Beta Was this translation helpful? Give feedback.
-
Hi 👋 thanks for writing in. I'll pass the feedback along. I'm not really sure I see the issue with the first option in your list. Devcontainers are supported by more than just codespaces and it's not super uncommon for folks to put editor-specific configuration into a repository. It's definitely up to repo maintainers what configuration to allow in their repositories, but if they have contributors who want to use one of the editors or services that support devcontainers, it seems pragmatic to add configuration for devcontainers to the repository. To your second point, you could use a codespace with the default devcontainer like a local machine. Custom devcontainers are nice because it makes configuration consistent across multiple instances of the dev environment, but if you can't have a custom devcontainer, you can still customize a codespace using the default devcontainer by installing tools and configuring them manually. This wouldn't be any different from cloning locally except you would be able to access the environment remotely. |
Beta Was this translation helpful? Give feedback.
I was referring to the fact that you can manually install whatever tools you'd like into the normal default devcontainer. Obviously, if you delete that codespace and create another you'd have to install the tools you need again, but that's no different from using a local machine.
Another, more hacky alternative that would accomplish what you are looking for would be to have a dotfiles repository that installs tools. You can read the docs about how to setup dotfiles to automatically run a script when creating a codespace here: https://docs.github.com/en/codespaces/customizing-your-codespace/personalizing-github-codespaces-for-your-account#dotfiles.