'Is there a way to launch Visual Studio Code and force it to open in a Remote Container?
I regularly open Visual Studio Code via code .
and then have to click the Re-open in Container button.
Am I missing any shortcut to force it to do this from the command line?
Solution 1:[1]
You can open devcontainer directly with devcontainer CLI.
Install devcontainer CLI by running
Remote-Containers: Install devcontainer CLI
from VS Code. Then just run:
devcontainer open
in the same directory where you'd run code .
and you will skip the Re-open step.
Solution 2:[2]
There is a way to do this GUIcally in Windows. I suspect this will also work for SSH / WSL workspaces.
- Open your dev container in VSCode as usual.
- Right-click on your VSCode taskbar icon; it should show you a jump list with MRU workspaces.
- Look for that
[Dev Container]
list item (mine showslocalhost:2375
because that's my docker host). You might like to pin it. - You can open directly into the dev container by clicking on that item.
Solution 3:[3]
I have done this with ApiLogicServer - you build the .devcontainer file, plus the Dockerfile
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | bh213 |
Solution 2 | FSCKur |
Solution 3 | val |