dockerode icon indicating copy to clipboard operation
dockerode copied to clipboard

Possible to provide streams or a socket to Docker() initialization?

Open davclark opened this issue 5 years ago • 2 comments

With the shift to WSL2, docker performance is dramatically increased (especially on the file I/O). The way the Docker Desktop devs talk to the WSL2 proxy for the docker socket (which lets you use a faster WSL2 filesystem) is to use the wsl command on windows, there's a description here:

https://youtu.be/FD3UVCipmmE?t=2831

One easy way to do this is to run the node command in the WSL2 distro. But I'm running node inside an electron app on the Windows side (see https://github.com/gigantum/gigantum-desktop if you're curious).

Is there a way I could pass a stream to the Docker() initialization? Presumably it would be something that gets passed to the Modem() init, but I wanted to frame the issue from the perspective of how I'll be using it. Happy to move this issue to the docker-modem repo if that's appropriate.

davclark avatar Jul 01 '20 15:07 davclark

The opts object is passed to docker-modem (https://github.com/apocas/dockerode/blob/master/lib/docker.js#L32), so technically you could pass a stream docker-modem.

What do you want to do with that stream inside docker-modem?

apocas avatar Apr 05 '21 16:04 apocas

I'm no longer working on that project - though thank you for the response to this long-open issue! The idea was to have a way to get direct access to messages sent to stdout / stderr from an application working with Docker on WSL2 from a Windows runtime. IIRC, though, we sovled this by simply running a wsl subshell ourselves.

Not sure if this'll work, but:

cc: @Mazharrr

davclark avatar Apr 12 '21 17:04 davclark