简体   繁体   English

如何在 docker 容器中运行 VSCode

[英]How to run VSCode in a docker container

How can I run vscode in a docker container so I can open the UI in a web browser?如何在 docker 容器中运行 vscode,以便在 web 浏览器中打开 UI? I know it is possible because home-assistant can do it.我知道这是可能的,因为家庭助理可以做到。 It can only do it when hosted on a raspberry pi, not in a separate docker container or other home-assistant installs.它只能在托管在树莓派上时执行此操作,而不是在单独的 docker 容器或其他家庭助手安装中。 All the results I found online point at developing apps for executing in docker - in vscode that's running on your local machine.我在网上找到的所有结果都指向开发用于在 docker 中执行的应用程序 - 在本地计算机上运行的 vscode 中。 That's not what I want, I want to have a local vscode install hosted on my local server - that way I can set up my dev environment in one place and don't have to keep setting everything up on all of my machines.那不是我想要的,我想在我的本地服务器上托管一个本地 vscode 安装 - 这样我就可以在一个地方设置我的开发环境,而不必在我所有的机器上继续设置所有东西。

Looks like it's officially possible to self-host vscode server and access it through vscode.dev (also see this GitHub issue ).看起来正式可以自托管 vscode 服务器并通过 vscode.dev 访问它(另请参阅此GitHub 问题)。

For reaching it through custom URL consider using Gitpod's OpenVSCode Server fork of vscode.要通过自定义 URL 实现它,请考虑使用Gitpod 的 OpenVSCode Server fork of vscode。

If you just want to share your configuration between machines, it's probably simplest to just use settings sync , which is available in default installation.如果你只是想在机器之间共享你的配置,最简单的方法可能是使用设置同步,它在默认安装中可用。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM