Forum Discussion

David Hirschfeld's avatar
David Hirschfeld
Copper Contributor
Jul 31, 2017
Solved

Files in a host mapped volume aren't recognised

As the title says, with Insiders 16237, files in a host mapped volume aren't recognised - e.g.

type filename.txt

doesn't work.

 

Specifying the full path however does work:

type C:\MappedVolume\filename.txt

  

Is this a known issue? Is this an appropriate forum to ask questions about docker/containers on Insiders or should I ask on the moby repo?

  • Patrick Lang's avatar
    Patrick Lang
    Aug 14, 2017

    Thanks for the detailed info! I found a dev familiar with the area and it's a known issue in that build. A fix is on the way so please try a new Insider release once it's out and let us know how it goes.

11 Replies

  • This should be working - can you share the full docker commandline and full console output of the error in the container?

    Thanks!
    Patrick
    • David Hirschfeld's avatar
      David Hirschfeld
      Copper Contributor

      On the server, create a temp dir with a txt file in it:

      [dc2dmat05]: PS C:\> mkdir temp
      
          Directory: C:\
      
      Mode                LastWriteTime         Length Name                                                                                                         
      ----                -------------         ------ ----                                                                                                         
      d-----       14/08/2017   8:17 AM                temp                                                                                               
      
      
      [dc2dmat05]: PS C:\> cd temp
      
      [dc2dmat05]: PS C:\temp> echo 'This is a test!' > test.txt
      
      [dc2dmat05]: PS C:\temp> type .\test.txt
      This is a test!
      
      [dc2dmat05]: PS C:\temp> 

       

      Use my (Win7) workstation to create an interactive tty session:

       

      C:\tmp
      λ $env:DOCKER_HOST='DC2DMAT05:2376'
      C:\tmp
      λ docker run -it -v C:/temp:C:/temp microsoft/windowsservercore-insider
      Microsoft Windows [Version 10.0.16237.1001]
      (c) 2017 Microsoft Corporation. All rights reserved.
      
      C:\>dir
       Volume in drive C has no label.
       Volume Serial Number is 7216-718A
      
       Directory of C:\
      
      07/03/2017  03:14 PM             1,894 License.txt
      07/02/2017  03:39 PM    <DIR>          PerfLogs
      07/03/2017  03:15 PM    <DIR>          Program Files
      07/02/2017  03:39 PM    <DIR>          Program Files (x86)
      08/14/2017  08:15 AM    <DIR>          temp
      07/03/2017  03:16 PM    <DIR>          Users
      07/03/2017  03:14 PM    <DIR>          Windows
                     1 File(s)          1,894 bytes
                     6 Dir(s)  21,206,704,128 bytes free
      
      C:\>cd temp
      
      C:\temp>dir
       Volume in drive C has no label.
       Volume Serial Number is 7216-718A
      
       Directory of C:\temp
      
      08/14/2017  07:55 AM    <DIR>          .
      08/14/2017  07:55 AM    <DIR>          ..
      08/14/2017  07:55 AM                36 test.txt
                     1 File(s)             36 bytes
                     2 Dir(s)  50,829,029,376 bytes free
      
      C:\temp>type test.txt
      The system cannot find the path specified.     <-- !! Doesn't work !!!!!!!!!!
      
      C:\temp>type .\test.txt
      The system cannot find the path specified.
      C:\temp>type C:\temp\test.txt <- !! Works only with the full path !! This is a test! C:\temp>copy test.txt C:\test.txt <- !! Again, doesn't work without full path !!
      The system cannot find the path specified.
      0 file(s) copied.

      C:\temp>copy C:\temp\test.txt C:\test.txt
      1 file(s) copied.

      C:\temp>cd ..

      C:\>type test.txt <-- !! Commands work fine when file isn't in a host mapped volume !!
      This is a test!

      C:\>

       

      • David Hirschfeld's avatar
        David Hirschfeld
        Copper Contributor
        This is a problem because if you map a host volume with config files for an app running on the container the app doesn't believe the config files exist :(

Resources