moby: Unable to read a symlink in a mounted volume from inside a Windows Container
Description On Windows Server 2016 host created a symlink pointing to a text file inside working directory and mounted the working directory as a volume for windowsservercore container. Accessing the symlink from Windows host works but fails from within the container
Steps to reproduce the issue:
- Create a text file in temp/work directory
PS C:\wd\test> echo "Symlink Test" > test.txt
- Create a symlink pointing to the text file
PS C:\wd\test> cmd /c mklink symtmp.txt test.txt
- Run windowsservercore container and mount the working directory as volume
docker run --rm -v c:\wd\test:c:\wd\test -it microsoft/windowsservercore cmd
Describe the results you received: Inside the container run
PS C:\> type C:\wd\test\symtmp.txt
type : Could not find a part of the path 'C:\wd\test\symtmp.txt'.
At line:1 char:1
+ type C:\wd\test\symtmp.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\wd\test\symtmp.txt:String) [Get-Content], DirectoryNotFoundException
+ FullyQualifiedErrorId : GetContentReaderDirectoryNotFoundError,Microsoft.PowerShell.Commands.GetContentCommand
Describe the results you expected:
PS C:\wd\test> type .\symtmp.txt
Symlink Test
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker version
:
PS C:\wd> docker version
Client:
Version: 1.12.2-cs2-ws-beta
API version: 1.25
Go version: go1.7.1
Git commit: 050b611
Built: Tue Oct 11 02:35:40 2016
OS/Arch: windows/amd64
Server:
Version: 1.12.2-cs2-ws-beta
API version: 1.25
Go version: go1.7.1
Git commit: 050b611
Built: Tue Oct 11 02:35:40 2016
OS/Arch: windows/amd64
Output of docker info
:
PS C:\wd> docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 37
Server Version: 1.12.2-cs2-ws-beta
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: nat null overlay transparent
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 14393 (14393.447.amd64fre.rs1_release_inmarket.161102-0100)
Operating System: Windows Server 2016 Standard Evaluation
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 8 GiB
Name: WIN-V1B1M3827A2
ID: YWMF:AR23:AK2D:W3KJ:W22Z:6KQ3:LTPR:TOJP:ZCD3:WM3Z:NHRA:RLM6
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Additional environment details (AWS, VirtualBox, physical, etc.):
- Physical
- winver : Windows Server 2016 Version 1607 (OS Build 14393.447)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 20 (5 by maintainers)
After discussion with some Windows devs, unfortunately this won’t work in Windows Server 2016. It’s on the list to look at in the next version of Windows Server.
@jhowardmsft so this shouldn’t be closed? It affects Docker behavior. Is it at least documented as a limitation from Microsoft?