lorne 2021-08-18
.vscode/settings.json
file{
"docker.host": "ssh://root@10.13.14.123"
}
Using SSH requires a supported SSH client, that you have key based authentication configured for the remote host, and that the key is imported into your local SSH agent. See the article on using SSH Keys with Git for details on configuring the agent and adding your key.
F1
search :Remote Container : clone repository form container volumeThe Language Support for Java server crashed 5 times in the last 3 minutes. The server will not be restarted.
install lombok for Language Support for Java
There's two variations of this setup. The first is to create your remote dev container first, and then clone your source code into a named volume since this does not require you to have direct access to the filesystem on the remote host.
Here is a basic devcontainer.json
example of this setup:
{
"image": "node", // Or "dockerFile"
"workspaceFolder": "/workspace",
"workspaceMount": "source=remote-workspace,target=/workspace,type=volume"
}
In fact, the Remote-Containers: Clone Repository in Container Volume... command in the Command Palette (F1) uses this same technique. If you already have a devcontainer.json
file in a GitHub repository that references an image or Dockerfile, the command will automatically use a named volume instead of a bind mount - which also works with remote hosts.
The second approach is to bind mount a folder on the remote machine into your container. This requires you to have access to the remote filesystem, but also allows you to work with existing source code on the remote machine.
Update the workspaceMount
property in the example above to use this model instead:
"workspaceMount": "source=/absolute/path/on/remote/machine,target=/workspace,type=bind,consistency=cached"
In either case, to try it out, run Remote-Containers: Open Folder in Container..., and select the local folder with the .devcontainer.json
file in it.
Developing inside a Container using Visual Studio Code Remote Development
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。