floatdrop / gulp-watch

Watch, that actually is an endless stream
MIT License
642 stars 99 forks source link

File system notifications when using Docker for Mac Beta #228

Open shankie-codes opened 8 years ago

shankie-codes commented 8 years ago

I'm using the Docker for Mac Beta – which is supposed to have better support for file system notifications than Docker Toolbox/boot2docker, but I still can't get gulp-watch working without using polling.

e.g., this doesn't work:

gulp.task('watch-test', function(){
  watch(path.resolve('/source/_/scss/**/*.scss'), function(file) {
      gulp.start('sass')
  })
  });

but this does:

gulp.task('watch-test', function(){
  watch(path.resolve('/source/_/scss/**/*.scss'), { usePolling: true, interval: 2000 }, function(file) {
      gulp.start('sass')
  })
  });

N.B. Using a polling interval of 2000 seems to be a good compromise between responsiveness and CPU usage (it was 30% if I didn't reduce the interval).

Anyone have any success using this in a Docker container?

jackmcpickle commented 8 years ago

@shankiesan I believe its a current issue with docker for mac beta, I know a colleague was having similar issues. Check out the docker forums. This post? https://forums.docker.com/t/docker-compose-volumes-gulp-watch-100-cpu-usage/10192

shankie-codes commented 8 years ago

Hehe thanks @jackmcpickle I just posted there... 😄

UltCombo commented 8 years ago

Can you please file an issue in the Chokidar repository? That's your best bet to get non-polling watcher support in Docker containers.