How to use vscode remote containers with Docker Toolbox (Windows 7)?

早过忘川 提交于 2020-05-14 08:54:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!