Skip to content

bind mount inotify events not delivered after container restart #681

@genei09

Description

@genei09

Expected behavior

changes to OSx filesystem are picked up by the webpack process

Actual behavior

Even though the files are changed, no change is detected
Using the same docker image in Dinghy produces the expected results

Information

  - Full output of the diagnostics from "Diagnose & Feedback" in the menu
Docker for Mac: version: 1.12.1 (2d5b4d9)
OS X: version 10.11.6 (build: 15G31)
logs: /tmp/F23DDA4B-1399-4A2B-90FD-C7D873FCEDD5/20160920-140135.tar.gz
[OK]     docker-cli
[OK]     virtualization kern.hv_support
[OK]     menubar
[OK]     moby-syslog
[OK]     dns
[OK]     disk
[OK]     system
[OK]     app
[OK]     osxfs
[OK]     virtualization VT-X
[OK]     db
[OK]     slirp
[OK]     logs
[OK]     env
[OK]     vmnetd
[OK]     moby-console
[OK]     moby
[OK]     driver.amd64-linux

Steps to reproduce the behavior

Dockerfile:

FROM qajenkins.windsorcircle.com/centos:7

ENV PGTZ=UTC
VOLUME /tmp
Run yum -y update; yum clean all &&\
 yum -y install tkinter openjpeg2-devel openjpeg2 libtiff-devel freetype-devel lcms2-devel libwebp-devel libwebp-tools &&\
 yum -y install logwatch sendmail-cf sysstat patch python-pip python-devel libpqxx-devel libxml++-devel python-lxml libjpeg-devel libxslt-devel libxml2-devel libyaml-devel git bzip2 freetype fontconfig gcc gcc-c++ make tar wget epel-release sudo; yum clean all &&\
 yum -y install inotify-tools &&\
 yum -y reinstall glibc-common &&\
 yum clean all

make a shell script inotifyrun and mount that directory as a volume
script:

#!/bin/sh
FORMAT=$(echo -e "\033[1;33m%w%f\033[0m written")
"$@"
while inotifywait -qre close_write --format "$FORMAT" .
do
    "$@"
done

example docker run command

docker run -it --name test_inotify --volume ~/Repos/APP_REPOS/:/opt/APP_REPOS 634faa2f65e8 bash

run the shell script
cd /opt/APP_REPOS
./inotifyrun.sh tail test.log

using VIM or other local file editor make a test.log file in the mounted dir and see no change

stop the shell script
copy to ~/
run the same experiment but exec into the container and use VI to make/modify the file.
the changes are detected and the tail command runs.

Metadata

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