none
Volumes not behaving as expected RRS feed

  • Question

  • When trying to use volumes with containers the volumes do not behave as expected.  Volumes are being created but when the container begins to start it fails because the directory is not empty.  The expected behavior is that the contents of the directory would be copied to the volume.  I have had a colleague test this under Linux and it works fine.

    Docker Version

    PS E:\docker\windows\core> docker version
    Client:
     Version:      17.03.0-ce
     API version:  1.26
     Go version:   go1.7.5
     Git commit:   60ccb22
     Built:        Thu Mar  2 01:11:00 2017
     OS/Arch:      windows/amd64

    Server:
     Version:      17.03.0-ce
     API version:  1.26 (minimum version 1.24)
     Go version:   go1.7.5
     Git commit:   60ccb22
     Built:        Thu Mar  2 01:11:00 2017
     OS/Arch:      windows/amd64
     Experimental: false

    Windows Version

    PS E:\docker\windows\core> [System.Environment]::OSVersion.Version

    Major  Minor  Build  Revision
    -----  -----  -----  --------
    10     0      14393  0

    Dockerfile

    FROM microsoft/windowsservercore
    SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Continue'; $ProgressPreference = 'SilentlyContinue';"]
    WORKDIR /
    RUN New-Item -ItemType directory -Path C:\voltest
    RUN New-Item -ItemType directory -Path C:\voltest\a
    RUN New-Item -ItemType directory -Path C:\voltest\b

    docker-compose.yaml

    docker-compose.yaml

    version: '2.1'
    services:
      voltest:
        build: .
        volumes:
          - voltest:C:\voltest
    volumes:
      voltest:
        driver: local
    networks:
      default:
        external:
          name: nat

    Build and Error

    PS E:\docker\windows\core> docker-compose up
    Creating volume "core_voltest" with local driver
    Building voltest
    Step 1/6 : FROM microsoft/windowsservercore
     ---> 2c42a1b4dea8
    Step 2/6 : SHELL powershell -Command $ErrorActionPreference = 'Continue'; $ProgressPreference = 'SilentlyContinue';
     ---> Running in 560b4ca6eae8
     ---> 2feb8a2240cb
    Removing intermediate container 560b4ca6eae8
    Step 3/6 : WORKDIR /
     ---> c50fecc77c04
    Removing intermediate container 9458e01f9a8c
    Step 4/6 : RUN New-Item -ItemType directory -Path C:\voltest
     ---> Running in ba2262ff2899


        Directory: C:\


    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    d-----        9/12/2017   4:46 PM                voltest


     ---> b53f12eb0240
    Removing intermediate container ba2262ff2899
    Step 5/6 : RUN New-Item -ItemType directory -Path C:\voltest\a
     ---> Running in 1b167488fb3a


        Directory: C:\voltest


    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    d-----        9/12/2017   4:47 PM                a


     ---> f1832eba6c2e
    Removing intermediate container 1b167488fb3a
    Step 6/6 : RUN New-Item -ItemType directory -Path C:\voltest\b
     ---> Running in 8e2101eea848


        Directory: C:\voltest


    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    d-----        9/12/2017   4:47 PM                b


     ---> f37458d6b7c4
    Removing intermediate container 8e2101eea848
    Successfully built f37458d6b7c4
    WARNING: Image for service voltest was built because it did not already exist. To rebuild this image you must use `docke
    r-compose build` or `docker-compose up --build`.
    Creating core_voltest_1 ...
    Creating core_voltest_1 ... error

    ERROR: for core_voltest_1  Cannot start service voltest: container 8ce8a50a8d8d3710bcb11f037fe5c70bb3cab60f513461116c96a
    eb9d267f707 encountered an error during CreateContainer: failure in a Windows system call: The directory is not empty. (
    0x91) extra info: {"SystemType":"Container","Name":"8ce8a50a8d8d3710bcb11f037fe5c70bb3cab60f513461116c96aeb9d267f707","O
    wner":"docker","IsDummy":false,"VolumePath":"\\\\?\\Volume{92db9165-76f5-11e7-a8a9-005056bcad69}","IgnoreFlushesDuringBo
    ot":true,"LayerFolderPath":"C:\\ProgramData\\docker\\windowsfilter\\8ce8a50a8d8d3710bcb11f037fe5c70bb3cab60f513461116c96
    aeb9d267f707","Layers":[{"ID":"e06d13dc-dc1f-5da1-8ef4-5e95328ed94a","Path":"C:\\ProgramData\\docker\\windowsfilter\\a99
    86bd5c93e77a7b870a7ed6fa3ce21fa71035c98bb6490668ae745a3bf9fbe"},{"ID":"cc1da01d-4b6e-5559-8990-0e2ee8fb94c5","Path":"C:\
    \ProgramData\\docker\\windowsfilter\\611fec4ed1fecf415ba02e7b7954743aa7414ac754cefe9598ad2445bb79e41c"},{"ID":"a30106a0-
    7193-5938-a4b2-e074c7fe9d38","Path":"C:\\ProgramData\\docker\\windowsfilter\\f04ed0694727f41dd30295751f0e1cc61bd1fafab76
    bd43dbd7c1142a0df6f8a"},{"ID":"9ea10c76-7914-58cc-aa4a-37deccd27080","Path":"C:\\ProgramData\\docker\\windowsfilter\\3a0
    bcc776227d7fbc26132df85ff50857ddb184677861cb7f3420967541c595c"},{"ID":"88adfcdf-cd39-5751-85df-b6fc90d7a695","Path":"C:\
    \ProgramData\\docker\\windowsfilter\\22fd0fd3505e83bbf02bbed31c90f2ca0a920da8a75d2ef3a54316b0e42c354d"},{"ID":"2f0f52a5-
    30b1-5049-b2ee-51df52782d97","Path":"C:\\ProgramData\\docker\\windowsfilter\\6226bf187d946924ba25264fc12b73e94a650ed5199
    14ccc38e7a51951f0aafe"},{"ID":"a3a4a90e-35d8-54ee-9609-d4b3a826e342","Path":"C:\\ProgramData\\docker\\windowsfilter\\169
    6363843dfb3ed53bfde3bc9b2528847aa789b45e7c370b721daa367ea47f7"}],"HostName":"8ce8a50a8d8d","MappedDirectories":[{"HostPa
    th":"C:\\ProgramData\\docker\\volumes\\core_voltest\\_data","ContainerPath":"c:\\voltest","ReadOnly":false,"BandwidthMax
    imum":0,"IOPSMaximum":0}],"HvPartition":false,"EndpointList":["faeaaaa1-69a5-4e9c-b40e-948f997aade8"],"Servicing":false,
    "AllowUnqualifiedDNSQuery":true}

    ERROR: for voltest  Cannot start service voltest: container 8ce8a50a8d8d3710bcb11f037fe5c70bb3cab60f513461116c96aeb9d267
    f707 encountered an error during CreateContainer: failure in a Windows system call: The directory is not empty. (0x91) e
    xtra info: {"SystemType":"Container","Name":"8ce8a50a8d8d3710bcb11f037fe5c70bb3cab60f513461116c96aeb9d267f707","Owner":"
    docker","IsDummy":false,"VolumePath":"\\\\?\\Volume{92db9165-76f5-11e7-a8a9-005056bcad69}","IgnoreFlushesDuringBoot":tru
    e,"LayerFolderPath":"C:\\ProgramData\\docker\\windowsfilter\\8ce8a50a8d8d3710bcb11f037fe5c70bb3cab60f513461116c96aeb9d26
    7f707","Layers":[{"ID":"e06d13dc-dc1f-5da1-8ef4-5e95328ed94a","Path":"C:\\ProgramData\\docker\\windowsfilter\\a9986bd5c9
    3e77a7b870a7ed6fa3ce21fa71035c98bb6490668ae745a3bf9fbe"},{"ID":"cc1da01d-4b6e-5559-8990-0e2ee8fb94c5","Path":"C:\\Progra
    mData\\docker\\windowsfilter\\611fec4ed1fecf415ba02e7b7954743aa7414ac754cefe9598ad2445bb79e41c"},{"ID":"a30106a0-7193-59
    38-a4b2-e074c7fe9d38","Path":"C:\\ProgramData\\docker\\windowsfilter\\f04ed0694727f41dd30295751f0e1cc61bd1fafab76bd43dbd
    7c1142a0df6f8a"},{"ID":"9ea10c76-7914-58cc-aa4a-37deccd27080","Path":"C:\\ProgramData\\docker\\windowsfilter\\3a0bcc7762
    27d7fbc26132df85ff50857ddb184677861cb7f3420967541c595c"},{"ID":"88adfcdf-cd39-5751-85df-b6fc90d7a695","Path":"C:\\Progra
    mData\\docker\\windowsfilter\\22fd0fd3505e83bbf02bbed31c90f2ca0a920da8a75d2ef3a54316b0e42c354d"},{"ID":"2f0f52a5-30b1-50
    49-b2ee-51df52782d97","Path":"C:\\ProgramData\\docker\\windowsfilter\\6226bf187d946924ba25264fc12b73e94a650ed519914ccc38
    e7a51951f0aafe"},{"ID":"a3a4a90e-35d8-54ee-9609-d4b3a826e342","Path":"C:\\ProgramData\\docker\\windowsfilter\\1696363843
    dfb3ed53bfde3bc9b2528847aa789b45e7c370b721daa367ea47f7"}],"HostName":"8ce8a50a8d8d","MappedDirectories":[{"HostPath":"C:
    \\ProgramData\\docker\\volumes\\core_voltest\\_data","ContainerPath":"c:\\voltest","ReadOnly":false,"BandwidthMaximum":0
    ,"IOPSMaximum":0}],"HvPartition":false,"EndpointList":["faeaaaa1-69a5-4e9c-b40e-948f997aade8"],"Servicing":false,"AllowU
    nqualifiedDNSQuery":true}
    ERROR: Encountered errors while bringing up the project.


    Wednesday, September 13, 2017 5:04 PM

All replies