问HN:有没有适合微虚拟机的设置,以实现类似VS Code开发容器的体验?

1作者: Erndob2 个月前原帖
我目前的开发环境是在本地运行的开发容器中进行的。<p>我打开 VS Code,然后在开发容器中打开本地文件夹。这个本地文件夹会被挂载到容器中,以便进行持久化更改。容器的 Dockerfile 是我设置开发依赖的地方。在容器内,我可以进行任何我想要的全局安装,这些安装在会话之间保持持久,而项目的编辑则保留在主机上。<p>这个设置对我来说很好,我很喜欢。我可以在 VS Code 的终端中运行 CLI codent 代理,同时仍然享有良好的开发体验。<p>现在,我希望能够基本上实现这种工作流程,但基于 MicroVM,主要解决的问题是让我能够在这个 MicroVM 内运行 Docker,因为 Docker-in-Docker 的效果不好。此外,如果我能在 MicroVM 内使用密钥而不暴露它们,那就太好了。<p>不过,我花了相当多的时间检查不同的 MicroVM,发现有几个问题:<p>- 许多 MicroVM 是为短期的临时任务设计的,而不是一个能够轻松持久化并且具有容器持久性与主机持久性分离的长期开发环境。<p>- 我不认为它们与 VS Code 或其他开发工具集成?难道你应该把 VS Code 安装到 MicroVM 本身,而不是让主机上的 VS Code 与它交互?<p>- Docker 发布的沙箱在某种程度上满足了我的需求,但它仅限于 AI 代理,并且只支持他们所提供的那些。你不能拥有自己的自定义环境来做你想做的事情。<p>所以我感到困惑。有很多不同的解决方案,但似乎没有一个能满足我的需求,我只想要一个像 Dev-Container 的体验,稍微安全一些,并且能够让我在其中使用 Docker。
查看原文
My current setup is just doing my entire development in a dev container that is running locally.<p>I open VS Code, I open the local folder in a dev container. The local folder gets mounted into container for persistent changes. The container dockerfile is my setup of dev dependencies. Within the container I can do whatever global installs I want that persist between sessions, and the project edits persist on host machine.<p>That works and I like the setup. I can run CLI codent agent in the terminal of VS Code, while still having good dev experience.<p>Now, I would like to have basically this flow but be MicroVM based, where the main thing I solve is allowing me to run docker inside that microvm, as docker-in-docker does not work well. Additionally if I could use secrets without them being exposed in the microvm itself, that would be amazing.<p>But I&#x27;ve spent a good amount of time checking different microvm&#x27;s, and there&#x27;s a few issues:<p>- A lot of them are designed for short ephemeral tasks, not a long running dev environment that easily persists and has separation of container persistence and host persistence<p>- I don&#x27;t think they integrate with VS Code or other dev tools? Are you supposed to install vs code into the microVM itself, instead of having host VS Code interact with it?<p>- Docker released sandboxes which kinda does what I need, but it is JUST ai agents. And only the ones they support. You can&#x27;t have your own custom environment where you do what you want.<p>So I am confused. There&#x27;s tons of different solutions and none of them seem to work, all I want is to have Dev-Container like experience that is a bit more secure and can allow me to do Docker inside of it.