fswatch错误,当试图运行在一个Windows泊坞窗容器反应

我正在运行一个unbuntu:在win10上使用Docker Toolbox的最新Docker容器。 我使用create-react-app npm为我自动创build一个反应应用程序。 当我运行“npm start”时,出现以下错误。

events.js:182 throw er; // Unhandled 'error' event ^ Error: watch /frontend/public EMFILE at _errnoException (util.js:1026:11) at FSWatcher.start (fs.js:1383:19) at Object.fs.watch (fs.js:1409:11) at createFsWatchInstance (/frontend/node_modules/chokidar/lib/nodefs-handler.js:37:15) at setFsWatchListener (/frontend/node_modules/chokidar/lib/nodefs-handler.js:80:15) at FSWatcher.NodeFsHandler._watchWithNodeFs (/frontend/node_modules/chokidar/lib/nodefs-handler.js:228:14) at FSWatcher.NodeFsHandler._handleDir (/frontend/node_modules/chokidar/lib/nodefs-handler.js:407:19) at FSWatcher.<anonymous> (/frontend/node_modules/chokidar/lib/nodefs-handler.js:455:19) at FSWatcher.<anonymous> (/frontend/node_modules/chokidar/lib/nodefs-handler.js:460:16) at FSReqWrap.oncomplete (fs.js:154:5) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! frontend@0.1.0 start: `react-scripts start` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the frontend@0.1.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2017-09-19T00_53_33_776Z-debug.log 

很简单的东西 – 这是我的dockerFile

 FROM ubuntu:latest ENV DEBIAN_FRONTEND noninteractive RUN apt-get update RUN apt-get install -y apt-utils RUN apt-get install -y curl #RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - RUN apt-get install -y nodejs # install editor RUN apt-get install -y vim # install tools and create frontend RUN npm install -g create-react-app RUN create-react-app frontend # configure proxy (let's frontend talk to backend) RUN sed '$i,\n"proxy": "http://localhost:3001"' frontend/package.json >> frontend/package.json.new RUN cp frontend/package.json.new frontend/package.json WORKDIR /frontend # run the frontend CMD npm start 

我可以在我的Mac上构build相同的dockerfile,它工作正常。 FSWatch是一些图书馆,检查文件是否改变 – 所以不确定这里发生了什么。 我有点难住 任何帮助将不胜感激。

Docker Toolbox不支持文件系统事件通知。 (由Docker dev Mano Marks确认)。 需要使用“Docker for Windows”才能正常工作。

猜猜MSFT正在让我失望一些。

Interesting Posts