Open eamon-straughn opened 2 weeks ago
I experience the same issues in docker desktop since >= 4.33 on my Mac with M1 cpu and it seems to be related to symlinks as far as my tests went.
The compose.yml looks like this
services:
mount:
image: alpine
environment:
- TZ=Europe/Berlin
volumes:
- /Users/hendrik/Webserver/test:/var/www/html:consistent
tty: true
I have a single text file in this folder
/var/www/html # ls
test.txt
/var/www/html # cat test.txt
1234
Then I created a symlink on the host system to this file and can access it inside the container ln -s test.txt link
/var/www/html # ls
link test.txt
/var/www/html # cat link
1234
I then deleted the symlink on the host system. Inside the container it looks like the symlink is not available anymore but can still be accessed
/var/www/html # ls
test.txt
/var/www/html # cat link
1234
Also I tried to create the file named link
from within the container. There is no error but the file is also not created
/var/www/html # touch link
/var/www/html # ls
test.txt
When Docker Desktop is downgraded to 4.32.0 the above tests work as expected. If the symlink file is deleted or changed on the host system it reflects immediately in the container.
/var/www/html # ls
test.txt
/var/www/html # cat link
cat: can't open 'link': No such file or directory
Description
We can make changes to code on versions <= 4.32 but when we upgrade to any of the new versions no changes occur because the volume is not syncing with the host.
Reproduce
here’s my script for creating volumes docker volume create --driver local --opt type=none --opt device=/var/www --opt o=bind www docker volume create --driver local --opt type=none --opt device=/var/pgsql --opt o=bind pgsql sudo chown -R $USER:wheel /var/www sudo chown -R $USER:wheel /var/pgsql
here’s some of my composer file volumes: www: external: true pgsql: external: true
services: php-fpm: container_name: php-fpm restart: always build: context: . dockerfile: ./php/DockerFile ports:
httpd: container_name: httpd restart: always build: context: . dockerfile: ./httpd/DockerFile ipc: host privileged: true volumes:
Expected behavior
Should work like previous versions where you can make changes on the host and it updates on the container
docker version
docker info
Diagnostics ID
29CD53F1-757D-4C7A-9A73-BB455ED91723/20240912114209
Additional Info
4.32 and previous works perfectlt