-
Notifications
You must be signed in to change notification settings - Fork 304
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
Remote WSL and Docker Extension limitations #155
Comments
These docs are likely copied and pasted from https://github.com/Microsoft/vscode-dev-containers/tree/master/containers/docker-in-docker That does not mean they do not apply. The "Docker Extension" itself is considered to only be a "local" extension. It cannot be installed on a "remote" like WSL. This section in the docs refer to that point. The settings snippet they give allow you override the default behavior and tell VS Code that Docker is in fact a remote extension. I do not have Docker installed on my Windows machine, but I did play around with it a bit using the link from above. What you should be able to do is add the following to your User Settings on your Windows 10 host: "remote.extensionKind": {
"peterjausovec.vscode-docker": "workspace"
} Then inside of a WSL install with Docker set up and configured according to the article you linked above, add the following to your Remote settings inside of your WSL host: "docker.host": "localhost:2375", This should make your Docker side-bar tab and extension function. However it is imporant to know, that I have noticed that you cannot nest Remotes. So you cannot do anything with the Remote - Container extension while you are already using the Remote - WSL extension. You will not be able to use the "Attach Visual Studio Code" feature from the Docker side-bar tab. If you want to attach VS Code to a container and use the Remote - Container extension, you will have to attach VS Code manually from the Docker side-bar tab before you connect to a WSL host. |
I am not saying the guide does not apply or does not work, I am saying it is in fact superfluous in a WSL setup.
As far as I am aware, the extension can be installed in WSL. But it does not matter, because you are effectively still using the docker CLI in WSL which will call your docker daemon in your Windows Docker install, thus neglecting the need to even install the docker extension remotely in the first place. In addition, with the setup according to the article (which is the most common way afaik), you will not need to set "docker.host": "localhost:2375", as it is already set as an environment variable. |
Huh, I swear it was not working like that Friday night when I set everything up. It might have been, it was pretty late when I set it up. I thought that the Docker side-bar tab was not appearing unless you have the extension installed on the remote (in this case inside of WSL). Maybe you should make a PR to the docs to update them then, the author of the docs was probably just following the same assumption as the person who made the
You definetely still do. Your environment variable is only in your An example if you would like to test yourself: In Windows (CMD):
You can see it did not source your In WSL:
You noticed that without the |
@thernstig WSL is very much like containers. You can't run the docker daemon in a container either, but you can still control and deploy to another docker host using the CLI. This gives you the ability to do things like Docker build from the Linux side. You install the Docker CLI (not the docker daemon) and then connect to a host -- which as you pointed out can be done via TCP. In the containers case you forward the docker socket, but its a similar concept. We can refine the document to be more explicit about this last part. You can install the CLI without the daemon in the Linux world pretty easily (unlike Windows and mac where the two are bundled together in Docker Desktop). |
Updated in docs. Next time there's a push it will go out. Thanks for point it out! |
Regarding https://code.visualstudio.com/docs/remote/wsl#_docker-extension-limitations
The docker daemon (dockerd) is currently not well supported running inside WSL. A common workaround is to install Docker for Windows and then inside WSL install docker just to get access to the docker CLI. The docker CLI is then connected to Docker in Windows via localhost:2375. This can be seen here https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly
I am thus wondering if this section about the docker limitation in WSL is a bit misleading. It seems to be a copy&paste from the other two remote options. As an example, check this text, where container should probably say WSL.
Should the section be more explicit about that docker extension running locally in a WSL setup might "not" be a problem, due to the above mentioned reasons?
The text was updated successfully, but these errors were encountered: