Home > database >  Can docker container call host syscalls?
Can docker container call host syscalls?

Time:05-09

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?

CodePudding user response:

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.

  • Related