-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Volume files updated outside a container sometimes lose hardlink inside. #9524
Comments
Thanks for reporting this. I've tried to replicate the issue on my end with these using latest compose (2.6.0) : compose.yaml
Dockerfile
entrypoint.sh
I then tried to move the file back and forth while the container was running :
Using |
Hello, On my end, using your setup, I ended up with the following:
Moving the file manually out of the folder and back in (with mv or copy-paste in Nautilus) keeps the link (top two lines). I then ran the following commands:
Which then broke the link (second to third line). Running git checkout without a change in the file doesn't modify the file, and doesn't break the link, but when there is a change it does reset the file and break the link. Thank you for your help with this! |
Please double check this issue doesn't also apply when you run a plain |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Description
When using
git checkout -- <file>
on a file passed to a container, the file on the inside of the container loses its hardlink, breaking things unexpectedly.git checkout -- <file>
from a shell outside the container inside a folder that is passed through into the container does not produce this behavior.Steps to reproduce the issue:
git clone
this repository: https://github.com/madeline-holland/docker-bug-testtest.sh
Without using my test repository:
git checkout -- <file>
or (somethimes) moving the file to a different folder and back.ls -alh
column 2 = 0 rather than 1.Describe the results you received:
When updating a file outside a container which is passed through with git or sometimes moving it, the linked version inside loses its hardlink.
Describe the results you expected:
Upon updating a file outside the container, the linked version inside would likewise be updated, like when editing it with
nano
or another editor.Additional information you deem important (e.g. issue happens only occasionally):
This seems similar to this issue and this one too.
Output of
docker compose version
:Output of
docker info
:Additional environment details:
See this repository for more details.
My main question is this:
docker compose restart
can take quite a while when there's multiple images, so a less intensive solution would be quite helpful.The text was updated successfully, but these errors were encountered: