-
Notifications
You must be signed in to change notification settings - Fork 552
Description
Currently, the Docker extension is defaulting to a UI extension in all scenarios (SSH, Dev Containers, and WSL). That means it will show local containers/images, but anything accessing the file system or a terminal will fail. If users want to access remote containers/images, they must run as a workspace extension by adding this to their settings:
"remote.extensionKind": {
"ms-azuretools.vscode-docker": "workspace"
}
Here is my opinion of the ideal behavior for all three VS Code Remote scenarios:
SSH
This should default to a workspace extension. This would display containers/images from the remote machine and most things should "just work". It sounds like users want this as well (see #924).
Dev Containers
Running as a workspace extension (aka "Docker in Docker") is generally confusing and so we want to avoid it. However, this scenario inherently deals with a "Dockerfile" so we can't completely ignore it. Ideally this defaults to a UI extension. The explorer will show containers running on the local machine and we should show an understandable error if the users tries to run a command that requires the terminal or needs access to the file system.
This scenario could be improved if VS Code gives us the following:
- An API to create a terminal on the local machine (instead of in the container) to run commands like "Build Image"
- An API to access the file system in the container so that we can run commands like "Add Docker Files"
If the user is running as a workspace extension, we should show a custom message instead of the default "Unable to connect to Docker.". It should direct users to either switch to a UI extension or set up docker in docker (if they're feeling adventurous).
WSL
The ability to run docker inside WSL is pretty recent and it's unclear how well it's supported. If we were in an ideal world and docker worked great in WSL, I think this behavior should be similar to SSH. Otherwise, I think it makes sense to just pick a default and document how to change it if desired.
Questions for VS Code Remote team:
- Can we have a different default for "Dev Containers" (UI) vs "SSH" (Workspace)?
- How do we detect if our extension is running in remote - and what kind of remote? (So that we can customize the error message)
- Is there an official API to create a terminal on the local machine as a UI extension?
- Is there an official API to access the file system inside a container when running as a UI extension?