docker mount does not work with a single file? RRS feed

  • Question

  • If mounting a directory it will work:

    "docker run -it --rm -v C:\users\dong\Documents:c:\test windowsservercore powershell"

    If otherwise mount a single file:

    "docker run -it --rm -v C:\users\dong\Documents\sdksetup.exe:c:\test\sdksetup.exe windowsservercore powershell"

    It will give errors:

    docker : C:\Program Files\Docker\docker.exe: Error response from daemon: Invalid bind mount spec 
    "C:\\users\\dong\\Documents\\sdksetup.exe:c:\\test\\sdksetup.exe": Source 'c:\users\dong\documents\sdksetup.exe' is not a 
    At line:1 char:1
    + docker run -it --rm -v C:\users\dong\Documents\sdksetup.exe:c:\test\s ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (C:\Program File...ot a directory.:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError
    See 'C:\Program Files\Docker\docker.exe run --help'.

    Monday, June 13, 2016 2:59 PM


  • I can repo what you are seeing and will follow up on expected behavior. 

    This does work, but does not allow for custom labeling of the in-container directory:

    docker run -it -v c:\Share\file1.txt windowsservercore cmd

    Here is the in doc example - Windows Container Docs .


    • Marked as answer by Xied75 Tuesday, June 14, 2016 10:04 AM
    Monday, June 13, 2016 6:07 PM