Open silend opened 1 year ago
Update: I've just tested it on a fresh install of Pop!_OS 22.04 LTS / Ubuntu and it shows the same issue as described above.
The only things that were installed other than docker-desktop-4.12.0-amd64
(and setting up the repository as described here but not installing anything myself, rather let Docker Desktop install the Docker Engine) were:
Other than that the system is vanilla and shows the issue described here, so it is safe to say that the issue is not coming from a previously installed version of Docker Engine or docker-compose
.
Update: Made more tests on macOS 11.6 and vanilla installations of Ubuntu 22.04 LTS (not Pop!_OS)
macOS 11.6 using latest version of Docker Desktop: :heavy_check_mark: It works as expected and does not show the issue.
Ubuntu 22.04 with latest docker-ce
from https://download.docker.com/linux/ubuntu jammy/stable amd64
:
:heavy_check_mark: It works as expected and does not show the issue.
Ubuntu 22.04 with latest Docker Desktop from https://docs.docker.com/desktop/install/linux-install/: :negative_squared_cross_mark: Does show described issue.
I read from these testings that it is not a general Docker (Engine) issue, and also not caused by Docker Desktop behaving differently than Docker Engine, as the macOS version behaves as expected. The issue only shows in the (Ubuntu?) Linux version of Docker Desktop.
I am seeing the same issue on Docker Desktop with Ubuntu 22.04. But I have three separate projects, all of which use essentially the same Docker setup, and only 1 of them is experiencing the issue.
The same project run through Docker Engine, without Docker Desktop, on a colleagues Linux works fine.
I've had a very similar issue since switching from Docker CE to Docker Desktop as well: https://github.com/docker/desktop-linux/issues/30. My workaround was to use polling to watch the file changes.
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
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
Expected behavior
When a file in a mounted folder is changed on the host, file watchers (eg.
nodemon
) running inside the container should register that change.Actual behavior
The container only reflects the file change from host on restart. However, when the file is changed from inside the container (eg.
touch [file]
) watching processes (eg.nodemon
) register the file change and behave as expected.Information
I have recently switched from Docker Engine to Docker Desktop and noticed the problem with an existing project, that was working before on Docker Engine /
docker-compose
(version 1).The problem is reproducible and showing consistently, also when using a fresh example from Docker docs.
Docker Engine and
docker-compose
(version 1) was fully deinstalled before installing the latest version of Docker Desktop according to the instructions.To reproduce:
package.json
inside an empty directory with the following content:index.js
with the following content:When
index.js
is now changed on the host (eg. with VS Code),nodemon
does not restart within the container.If going inside the container using
docker exec -it [containerID] sh
and usingtouch index.js
the node process is restarted.It is not only an issue with
nodemon
. In my project it behaves the same way also withnuxt
.What is weird: After updating a file on the host, using
stat [filename]
shows the same size and modification date on both the host and inside the container, however the watching processes seem to be blind to this change.docker version
docker info