问题
I use Windows 7 and can't install Docker for Windows, so I use Docker Toolbox.
Docker Toolbox is not supported by Microsoft Visual Studio Code for Remote Container Development.
But I need to use this functionality with my docker toolbox.
There is an issue on Github not solved yet https://github.com/microsoft/vscode-remote-release/issues/95
回答1:
You need to start your docker-machine. Need last version of vscode (1.40.2+)
In your .devcontainer.json you can overwrite the workspace mount volumene command (More info here)
"workspaceMount": "src=//c/Users/yourusername/git/reponame,dst=/workspaces/reponame,type=bind,consistency=delegated"
VSCode search the default workspace inside the container in /workspaces with the same name as the original and opens it automatilly, but you can override this in .devconatiner if you need or open it manually.
Important: your repository should always be inside your windows user profile (%userprofile%). This is a requirement from Docker Toolbox.
Note: the problem with Docker Toolboox is that Visual Studio Code doesn't support the docker-machine mounting volumes by default. But this workaround can help you.
Updated 2020/05/13
Tested with 1.44 it still works but you can't use an env var to do this yet.
来源:https://stackoverflow.com/questions/59430679/how-to-use-vscode-remote-containers-with-docker-toolbox-windows-7