简体   繁体   English

如何使在我的笔记本电脑上运行的 Visual Studio 代码通过 ssh 连接到远程机器并在远程机器上的 docker 容器上构建/调试

[英]How do I make visual studio code running on my laptop connect to remote machine via ssh and build/debug on docker container on remote machine

I have a mac laptop where I am running Visual Studio code.我有一台运行 Visual Studio 代码的 Mac 笔记本电脑。 My source code lives on a bigger Linux machine which has docker installed, with a docker image that has my build environment.我的源代码位于安装了 docker 的更大的 Linux 机器上,docker 映像包含我的构建环境。 I would like to connect to the remote desktop via ssh, and then to the docker container to build, run and debug in VSCode.我想通过 ssh 连接到远程桌面,然后连接到 docker 容器以在 VSCode 中构建、运行和调试。 Is this possible?这可能吗? I have SSH, remote containers extensions installed.我安装了 SSH,远程容器扩展。 I can see the docker images but I cannot attach to the images after I run them.我可以看到 docker 图像,但在运行后无法附加到图像。

I think it's not possible with visual studio code, but with visual studio for Mac 2019, you can install Docker desktop for Mac and add support for Docker to your project.我认为使用 Visual Studio 代码是不可能的,但是使用 Visual Studio for Mac 2019,您可以为 Mac 安装 Docker 桌面并将对 Docker 的支持添加到您的项目中。 After that, you can run and debug your app in local container.之后,您可以在本地容器中运行和调试您的应用程序。

https://docs.microsoft.com/en-us/visualstudio/mac/docker-quickstart https://docs.microsoft.com/en-us/visualstudio/mac/docker-quickstart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 SSH 远程开发机器上调试 docker 中运行的 python 代码 - Debug python code running in a docker compose on a SSH remote development machine 如何连接到远程机器上的 docker mysql 容器 - How to connect to docker mysql container on remote machine Visual Studio Code-如何在Docker容器中远程调试python代码 - Visual Studio Code - how to remote debug python code in a Docker Container 通过 ssh 在远程机器上运行 docker 命令 - Running docker commands on remote machine through ssh 如何通过 jenkins 和 SSH 在远程机器中运行 docker 命令? - how to run docker commands in remote machine via jenkins and SSH? 如何将Docker Machine连接到远程Docker VirtualBox - How to connect Docker Machine to a remote Docker VirtualBox 如何在远程机器中生成 docker 容器 - How to spawn a docker container in a remote machine 如何在远程机器上运行 docker 容器 - How to run docker container in a remote machine 如何从在 docker 容器中运行的应用程序连接在我的机器上运行的 redis - How can I connect redis running on my machine from my app running in a docker container 从远程计算机连接到容器 - connect to container from a remote machine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM