Skip to content
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

symlinked directories don't work as bind mount source on 1803 technical preview #162

Closed
sesmith177 opened this issue Mar 9, 2018 · 1 comment

Comments

@sesmith177
Copy link
Contributor

Tested on Kernel Version: 10.0 17093 (17093.1000.amd64fre.rs_prerelease.180202-1400)

If the source of a bind mount is a symlink, container creation will succeed, but the directory will not be accessible inside the container. This is a regression from 1709. To reproduce:

$dockerImage = "microsoft/windowsservercore-insider:10.0.17093.1000"

$mountDir = "$env:TEMP\mountdir"
mkdir $mountDir

echo hello > "$mountDir\hello.txt"

$symlink = "$env:TEMP\symlink"
cmd.exe /c "mklink /D $symlink $mountDir"

docker run -v"$symlink":c:\containerDir $dockerImage cmd.exe /C "type c:\containerDir\hello.txt"

cmd.exe /c "rmdir $symlink"
rm -r -force $mountDir

The output of this script:

    Directory: C:\Windows\TEMP                                                                                                                 
                                                                                                                                               
                                                                                                                                               
Mode                LastWriteTime         Length Name                                                                                          
----                -------------         ------ ----                                                                                          
d-----         3/9/2018   9:09 AM                mountdir                                                                                      
symbolic link created for C:\Windows\TEMP\symlink <<===>> C:\Windows\TEMP\mountdir                                                             
The create operation failed because the name contained at least one mount point which resolves to a volume to which the specified device object is not attached.

On 1709, (with the container image changed appropriately) running the script show that the container mounts the symlinked directory correctly:

    Directory: C:\Windows\TEMP                                                    
                                                                                  
                                                                                  
Mode                LastWriteTime         Length Name                             
----                -------------         ------ ----                             
d-----         3/9/2018   9:07 AM                mountdir                         
symbolic link created for C:\Windows\TEMP\symlink <<===>> C:\Windows\TEMP\mountdir
hello                                                                             
@darstahl
Copy link
Contributor

darstahl commented Mar 9, 2018

Thanks for the report. We caught this bug internally a few weeks ago and this bug is fixed in the latest internal builds 😄

Testing on Kernel Version: 10.0 17119 .... It will flight to insider builds soon.

PS C:\test> .\mount.ps1


    Directory: C:\Users\vmadmin\AppData\Local\Temp


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----         3/9/2018  12:52 PM                mountdir
symbolic link created for C:\Users\vmadmin\AppData\Local\Temp\symlink <<===>> C:\Users\vmadmin\AppData\Local\Temp\mountdir
hello

@darstahl darstahl closed this as completed Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants