本文介绍了如何在Docker Toolbox(Windows 7)中使用vscode远程容器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Windows 7,并且无法为Windows安装Docker,所以我使用Docker Toolbox.

I use Windows 7 and can't install Docker for Windows, so I use Docker Toolbox.

用于远程容器开发的Microsoft Visual Studio Code不支持Docker Toolbox.

Docker Toolbox is not supported by Microsoft Visual Studio Code for Remote Container Development.

但是我需要在我的docker工具箱中使用此功能.

But I need to use this functionality with my docker toolbox.

Github上有一个尚未解决的问题 https://github. com/microsoft/vscode-remote-release/issues/95

There is an issue on Github not solved yet https://github.com/microsoft/vscode-remote-release/issues/95

推荐答案

您需要启动docker-machine.需要最新版本的vscode(1.40.2 +)

You need to start your docker-machine.Need last version of vscode (1.40.2+)

在您的.devcontainer.json文件中,您可以覆盖工作区挂载volumene命令(更多信息此处)

In your .devcontainer.json you can overwrite the workspace mount volumene command (More info here)

VSCode在/workspaces中以与原始名称相同的名称在容器内的默认工作空间中搜索并自动打开它,但是如果需要,您可以在.devconatiner中覆盖它,或者手动打开它.

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.

重要:您的存储库应始终位于Windows用户个人资料(%userprofile%)中.这是Docker Toolbox的要求.

Important: your repository should always be inside your windows user profile (%userprofile%). This is a requirement from Docker Toolbox.

注意:Docker Toolboox的问题在于,Visual Studio Code默认不支持docker-machine挂载卷.但是,这种解决方法可以为您提供帮助.

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.

更新2020/05/13

经过1.44测试后,它仍然可以工作,但是您还不能使用env var来做到这一点.

Tested with 1.44 it still works but you can't use an env var to do this yet.

这篇关于如何在Docker Toolbox(Windows 7)中使用vscode远程容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-10 22:16