Docker Community Forums

Share and learn in the Docker community.

Symlink fail via python on windows docker

docker

(Kotovas) #1

Expected behavior

_getfinalpathname (from python module ‘nt’ ) show path of symlink

Actual behavior

_getfinalpathname (from python module ‘nt’ ) couldn’t get path of symlink

Information

Windows Server 2016 (same problem fixed on Windows Server 1709 too)
Docker version 17.06.2-ee-6, build e75fdb8

Steps to reproduce the behavior

  1. mkdir c:\test
  2. docker run -v c:\test:c:\test -it python:3.6-windowsservercore
  3. from nt import _getfinalpathname
  4. _getfinalpathname(‘c:\’)
    5._getfinalpathname(‘c:\test’)

Step#4 Show ‘\\?\C:\’ - it’s OK

Step#5 Show Error

_getfinalpathname(‘c:\test’)
Traceback (most recent call last):
File “”, line 1, in
FileNotFoundError: [WinError 2] The system cannot find the file specified: ‘c:\test’


(Sam) #2

to do the -v with windows drive letters you need to use the unix syntax /c/path (if using -v)
or use the --volume,type=binf,source=c:\test,dest=c:\test

because in the -v parameter the colon ‘:’ is the separator between the host path and the container path