desktop-linux
desktop-linux copied to clipboard
inotify DELETE event not propagated from host to container
- [x] I have tried with the latest version of Docker Desktop
- [x] I have tried disabling enabled experimental features
- [x] I have uploaded Diagnostics
- Diagnostics ID: ea2ee2ff-fd0f-4408-b98b-42e236cd1bcd/20221204131648
Expected behavior
Given a container with inotify installed in it AND Given that inotify is monitoring a directory bind-mounted with docker-compose I expect that if I delete a file in that directory to see a DELETE event in the standard output
Actual behavior
inotify produces logs for moving/renaming/creating files but not for deleting them.
Information
This seems somehow related to this issue, after upgrading I noticed that inotify started reporting events. However, I'm not able to see any events on DELETE occurrences.
- Linux distro: Ubuntu
- Distro version: 22.04.1 LTS
- Docker Desktop Version: 4.15.0
Steps to reproduce the behavior
- My case is related to the development of a project, so I have a .env file in the root of the project with some values in it:
DOMAIN_NAME=thecastles.duckdns.org
# MySQL ----------------------------------------------------------
MYSQL_ROOT_PASSWORD=thepass
MYSQL_LOCAL_PORT=3306
MYSQL_LOCAL_PORT_TEST=3307
ADMINER_LOCAL_PORT=8800
MYSQL_CONTAINER_NAME=mysql
MYSQL_DATABASE=mm
MYSQL_USER=mm
MYSQL_PASSWORD=thepass
# FILE MANAGER ---------------------------------------------------
# can be comma-separated
FILE_MANAGER_PORT=3001
MUSIC_LOCAL_DIRECTORY=/media/christian/Data/Musica
MUSIC_CONTAINER_DIRECTORY=/music
- I execute
docker-compose -f docker-compose-dev.yml up --build --quiet-pull --remove-orphans -d
- I execute within the container
inotifywait -mr /music/
- I delete a file from the hosts in the
MUSIC_LOCAL_DIRECTORY
.
inotify produces logs for all the rest of the actions you can do on a file, but not regarding deletions.
The steps above probably could be simplified by running an Alpine image with inotify installed on it and a bind-mounted volume being monitored by inotify, something like:
FROM amazoncorretto:19-alpine
RUN apk update && apk add inotify-tools
WORKDIR /app
Hi, thanks for reporting the issue, and sorry for the inconvenience. We are looking into the problem.
hi @chrisvoo, I've got a partial fix for the missing DELETE
events. It's partial because it can only report events on the top most remaining file system node in case of recursive deletions. For example:
dir_a - file_1
- dir_b - file_2
- dir_c - file3
if dir_b
is deleted we'll only report a deletion event DELETE dir_b
for dir_a
, instead of that and events for each item inside dir_b
and a DELETE_SELF dir_b
.
Here is a dev build - https://desktop-stage.docker.com/linux/main/amd64/94439/docker-desktop-4.16.0-amd64.deb - which includes the fix. If you are willing, please give it a go and let me know if the fix works for your use case.
Hi @p1-0tr , using 4.16.2 (95914) this works whenever you delete a directory, not on single files. Do you think it will be possible to full extend this to single files? Thanks
There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale
comment.
If not, this issue will be closed in 30 days.
Prevent issues from auto-closing with a /lifecycle frozen
comment.
/lifecycle stale
Do we experience a regression?
I see this issue is closed https://github.com/docker/desktop-linux/issues/30; however, I experience the same problem with the latest docker-desktop on Linux:
Linux distro: Ubuntu Distro version: 22.04.1 LTS Docker Desktop Version: 4.26.1
I'm using a bind between the host and docker container, and only changes made directly inside the docker container are triggering notify
FYI: default docker context (not desktop-linux) is working without any issues