Coder devcontainer support & extensions
Coder somehow supports devcontainers, but when connecting to the devcontainer with vs code and cursor for example the defined extensions are not installed. It looks like that vs code or cusor do not understand that they are actually not in a devcontainer. Does anyone else ran into the same issue and has a workaround?
15 Replies
<#1420336493519437855>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
GitHub
Support for VS Code Extensions · Issue #68 · coder/envbuilder
The devcontainer spec supports pre-installing VS Code extensions. Could we support this with the code-server CLI (or even the official vscode-server for Remote SSH)? This came up from a prospect at...
So coder supports Dev Containers with two approaches: Either with
envbuilder
or the native devcontainer
CLI. Just want to confirm you're using envbuilder
and not the devcontainer
CLI approach?@Danielle Thanks for reaching out. We have defined the following
But cursor shows the following. ssh:... See screenshot
and it looks like the extensions are not beeing installed.
In addition we can see that we are inside of a devcontainer but the IDE does not seem to pick it up.
Does that make sense?
How are you connecting to the dev container? Via the Web UI or a different method? If via the Web UI, the "VSCode" button should take you straight into the dev container in VSCode's devcontainer mode
Through the open workspace functionality in vscode/ cursor and there I select first the workspace and then the devcontainer
Apologies for the late delay, I think vscode/cursor requires being opened in the same way as any other devcontainer to get the devcontainer functionality
How do I do this? @Danielle
I think I managed it. But it is very unpratical since there are a lot of steps involved? Is that something one can configure with a one blick button?
Just clicking the "VS Code Desktop" button from the website should work

Ha, how do I add it? Can you share the template? Thanks @Danielle
You can see the devcontainer definition we use internally
https://github.com/coder/coder/blob/main/.devcontainer/devcontainer.json
GitHub
coder/.devcontainer/devcontainer.json at main · coder/coder
Secure environments for developers and their agents - coder/coder
If you're not already seeing the "VS Code Desktop" button you might be on an older version of Coder. It should be there by default for dev containers in the last few versions
@Danielle where can I find the related template that you use for coder/coder?
The template we use to develop Coder?
https://github.com/coder/coder/blob/main/dogfood/coder/main.tf
GitHub
coder/dogfood/coder/main.tf at main · coder/coder
Secure environments for developers and their agents - coder/coder