问题
I am trying to setup a dev environment with boot2docker/Virtualbox. Sharing a folder on the host with the docker container works, but since it is shared through a Virtualbox shared folder inotify does not trigger inside the container (and the code is not reloaded).
Is there a way to get the source folder into a docker image with boot2docker that still triggers inotify in the container? I would rather not use polling, since using polling inside a Virtualbox share has a heavy CPU cost on the host.
回答1:
That is boot2docker limitation because of this double layers of indirection you have to go through one with Virtual box and another is with docker. Looks like you will be better off setting up your own Vagrant machine and use one of alternative methods to share the folders, either through NFS, RSYNC or Unison plugin mentioned in the comment above
来源:https://stackoverflow.com/questions/26956623/sharing-code-directory-from-host-with-boot2docker-does-not-call-inotify-on-guest