Search code examples
windowsdockermkfifo

babel-watch doesn't work from docker container on windows host when mounting a host directory as a network share


I'm using docker on Windows and my src directory is mounted as a network share inside the docker container (as opposed to COPY). So /var/app/server inside the docker is actually a network share whose actual location on my host is C:\...project\server. [sidenote, I'm not familiar with how docker works on linux, like does it still use network share for mount on linux as well? because if not then this might just be windows issue]

I'm using babel-watch which uses mkfifo, and since it's running inside the docker container (VM) mkfifo can't create a file-pipe in that network shared directory. [sidenote: babel-watch actually does works on windows outside docker with cygwin which has a mkfifo.exe utility]

server_1  | mkfifo: cannot create fifo `/var/app/server/116521-16-pz2v9g.ma216skyb9': Operation not permitted
server_1  | Unable to create named pipe with mkfifo. Are you on linux/OSX?

Is there any workaround to this?

I tried editing babel-watch source to have mkfifo create a file in /var/app or /var instead (where it would still be inside the realm of the docker container) and while this way mkfifo actually works, the file changes aren't seen by babel-watch. I guess fundamentally the file change info isn't able to propagate pass the network share barrier - /var/app/server (the mount point) to /var/app (real directory inside docker).


Solution

  • mkfifo requires Linux/OSX environment, while /var/app/server was mounted from Windows. So it does not works. So you should ADD or COPY instead of mount volume