使用 vscode 附加到远程主机上的容器

Attach to container on remote host with vscode

为了让我的数据科学工作流程有足够的计算能力,我在远程机器上使用 Docker 容器。虽然我可以通过 vscode-remote 连接到我的远程机器,但我无法连接到这台机器上的 Docker 容器 运行。有没有办法做到这一点?或者这是尚未实现的功能?

非常感谢!

是的,支持使用 VSCode 远程连接到远程容器并在其中进行开发,但它被视为 'advanced' 使用 'Remote - Containers' 功能。 (目前的主要用例包括通过 SSH 连接到远程 VM 和连接到本地容器。)

有关说明,请参阅此处:
Developing inside a container on a remote Docker host

Sometimes you may want to use the Remote - Containers extension to develop inside a container that sits on remote server. This section outlines how you can achieve this by using devcontainer.json or attaching to an existing remote container...