Skip to content

Mounts stop receiving inotify change events from Windows host #8479

Closed

Description

[x] I have tried with the latest version of my channel (Stable or Edge): tested under edge 2.3.6 47622 and stable 2.3.0.4 46911
[x] I have uploaded Diagnostics
Diagnostics ID: F6FACDFC-D90A-40E8-8A1A-FC5A6D749036/20200915092839

Windows Version: Microsoft Windows 10 Pro 2004 19041.508
Docker Desktop Version: edge 2.3.6 47622 and stable 2.3.0.4 46911
Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM: No

Expected behavior
File change events from editing in the host should propagate to the container to enable tools like modd, nodemon or webpack to re-compile files in-container.

Actual behavior
Event triggered when changes happen within the container but not when on host. The problem existed in the past #5701 but seems to have reappeared in the latest Docker for Windows versions.

Steps to reproduce the behavior

docker-compose.yml

version: '3.7'

services:
  test:
    image: alpine:latest
    container_name: test
    volumes:
      - ./tmp:/tmp
    command: sh -c "sleep 1000"

Using git-bash shell on Windows

$ docker-compose up --detach
Creating network "inotify-wait_default" with the default driver
Creating test ... done

$ winpty docker exec -it test sh

/ # apk add inotify-tools
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/1) Installing inotify-tools (3.20.2.2-r0)
Executing busybox-1.31.1-r16.trigger
OK: 6 MiB in 15 packages

/ # inotifywait --event modify,create,delete --recursive /tmp/ &
/ # Setting up watches.  Beware: since -r was given, this may take a while!
Watches established.

# event properly captured when file is created inside docker container
/ # touch /tmp/test
/tmp/ CREATE test
[1]+  Done                       inotifywait --event modify,create,delete --recursive /tmp/

/ # inotifywait --event modify,create,delete --recursive /tmp/ &
/ # Setting up watches.  Beware: since -r was given, this may take a while!
Watches established.

/ # exit

# event not captured when file is created on host
$ touch tmp/test2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions