Docker容器可以调用主机Syscalls吗?

发布于 2025-01-27 03:59:40 字数 196 浏览 2 评论 0原文

我正在MacOS 11.6上运行Docker容器(Alphine),该容器中有一个打字稿应用程序。我需要在主机上模拟和记录Docker的输入。是否可以以一种允许我的容器来设置docker,以使我的容器可以使用node.js osx-mouse软件包控制主机的输入,或者通过编写swift包装器创建cgevent s ?

I'm running a Docker container (alphine) on MacOS 11.6, there's a Typescript app in that container. I need to simulate and record input from Docker on host. Is it possible to setup Docker in a way that would allow my container to control host's input using node.js osx-mouse package, or by writing a Swift wrapper creating CGEvents?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

窝囊感情。 2025-02-03 03:59:40

几乎肯定是不可能的。总的来说,禁止Docker容器访问主机显示器或其他主机设备。由于Docker Desktop运行隐藏的Linux VM,因此特别困难:显示技术完全不同,VM层使其看起来像容器和主机在物理独立的系统上。

通常,如果您需要与主机显示或任何其他硬件进行交互,则在容器外运行任务要容易得多。

That's almost certainly not possible. In general Docker containers are prohibited from accessing the host display or other host devices. Since Docker Desktop runs a hidden Linux VM, it's especially difficult: the display technologies are totally different and the VM layer makes it look like the container and host are on physically separate systems.

As a general rule, if you need to interact with the host display or any other hardware, it's much easier to run the task outside a container.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文