-
Notifications
You must be signed in to change notification settings - Fork 291
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
Symbolic Links not Working as Expected #5778
Comments
@t0rr3sp3dr0 You are right that this doesn't work in 2.2.0.3: however, it didn't work in the previous version (2.1.0.5) either. My understanding, although I haven't verified this myself, is that it also doesn't work under Linux, and you get a dangling symlink like under Windows. NTFS junction points are a different matter. We do have a regression there in 2.2.0.3 compared to 2.1.0.5, but that is covered by #5582. |
I actually had this working until this week for at least 3 months and nothing has changed rather than the Docker version. I'm downgrading and testing to verify which version of Docker I was using. |
@stephen-turner, it does work on this version: For now I'll stay on the downgraded version until the issue is fixed. |
Hmmm, that's curious, because that version was the release candidate for 2.2, so should be nearly the same. But you're right, this is working in my experiments too. Maybe it didn't work in all cases, or maybe we broke it while fixing something else. I will consult with the lead engineer on this feature. |
To add some more data to this discussion, I tried to be systematic, created a link of every type I could think of, and tested them both with a Dockerfile COPY instruction and via mount. ResultsDocker Desktop 2.2.0.3 (42716)
AnalysisMount failed on the relative symlinks but successfully converted absolute symlinks to relative. Junctions were the reverse: absolutes failed but the relative succeeded. This is particularly interesting because they look identical from the Windows command-line. Both external links made it into the container with relative paths, but of course they point to a nonexistent location. Build brought everything into the image with no modifications, so all the absolute links and both junctions are dead. Neither external link works as they point to nonexistent locations. CommentsThe Docker Desktop team has done an amazing job making as much of this work as it does, but symlinks on Windows are a giant pitfall of "works/doesn't work". I'm hoping WSL 2 improves my Docker experience. |
Thanks for your experiments, @MagicShoebox. Following up on my previous comment: it didn’t actually work properly in 2.1.7.0. The files appeared, but they would stop syncing after a while, so you would see stale copies in the container. That’s why we reverted to the previous behaviour where dangling symlinks are just dangling. This matches the behaviour in the old Samba solution, as well as on Linux. For junctions, we now have a new private build that improves the situation. See #5582 for the main ticket on this. |
Same here. I had to backport to version 2.1.0.5 from 2.2.0.3 Now the links on windows work like expected. |
I just upgraded to 2.2.0.5, so I decided to rerun the tests I ran back on 2.2.0.3. ResultsDocker Desktop 2.2.0.5 (43884)
(rebuilt Dockerfile as above)
AnalysisMount succeeded on everything. Absolute paths were converted to relative paths so they still work inside the container. External links were converted, but point to nonexistent locations (as to be expected). This fixes the issue I was seeing in 2.2.0.3. Build behavior was unchanged. It brought everything into the image with no modifications, so all the absolute links and both junctions are dead. Neither external link works as they point to nonexistent locations. CommentsUnfortunately I don't have 2.1.0.5 data to compare against, but I think 2.2.0.5 is working as well or better than 2.2.0.3. Thanks so much for improving the experience. I'm going to test if this fixed my original issue with PHP Composer & local Repository links. |
Thanks for testing it, @MagicShoebox. |
Issues go stale after 90 days of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Expected behavior
Previously Docker would resolve the symbolic link before mapping the volume, so the link would be visible as a regular file inside the container and you would be able to access it even if its real path is not explicitly mounted.
Actual behavior
Now Docker is treating Windows symbolic links as Linux symbolic links, that way you may not be able to access the files if they are not bellow the mounted directory.
And if you have a symbolic link pointing to other driver on Windows, it is impossible to have a configuration that allow these symbolic links to resolved.
Information
Windows Version:
Microsoft Windows 10 Version 1909
Docker Desktop Version:
Docker Desktop 2.2.1.0
Are you running inside a virtualized Windows e.g. on a cloud server or on a mac VM:
No
The text was updated successfully, but these errors were encountered: