none
Docker cp fails with The filename, directory name, or volume label syntax is incorrect. RRS feed

  • Question

  • Is there a different source path format than "C:\test\results\." I need to use in docker cp to copy the files from the c:\test\results folder in the container? I'm running 17.06 ee on Server 2016 1709 build 16299.15

    Results File: c:\test\results\ContainerUser_TESTHOST_2018-10-01_08_12_10.trx
    Error response from daemon: GetFileAttributesEx \\?\Volume{8713c709-085d-43e0-9205-15a7d86efb87}\test\results\.: The filename, directory name, or volume label syntax is incorrect.

    PS D:\TestAgent\_work\18\s> docker version
    Client:
     Version:      17.06.2-ee-16
     API version:  1.30
     Go version:   go1.8.7
     Git commit:   9ef4f0a
     Built:        Thu Jul 26 16:43:19 2018
     OS/Arch:      windows/amd64

    Server:
     Engine:
      Version:      17.06.2-ee-16
      API version:  1.30 (minimum version 1.24)
      Go version:   go1.8.7
      Git commit:   9ef4f0a
      Built:        Thu Jul 26 16:52:17 2018
      OS/Arch:      windows/amd64
      Experimental: false

    Dockerfile:

    FROM microsoft/dotnet:2.1-sdk
    WORKDIR /test
    COPY ./ ./
    EXPOSE 1450
    RUN mkdir results
    ENTRYPOINT ["dotnet", "vstest", "./Microsoft.SqlServer.Test.NetCoreSmo.dll", "/logger:console;verbosity=Normal"]

    Powershell script snippet:

    $resultsFolder = "c:\test\results"
    $testSettings = "\test\localcontainer.runsettings"
    $filesToCopy = "c:\test\results\."
    $localFolder = $localResultsFolder.FullName

    docker run --name $testContainer -e "RESULTS_FOLDER=$resultsFolder" -e "TEST_DATABASE=$testDatabase" -e "TEST_HOSTNAME=$endpoint" -e "TEST_PASSWORD=$pwd" -e "TEST_USERNAME=sa" -h testhost $testContainer /settings:$testSettings /logger:trx --ResultsDirectory:$resultsFolder $testParams
    docker cp $testcontainer`:$filesToCopy $localFolder
    docker rm $testcontainer
    docker rmi $testcontainer


    This posting is provided "as is" and confers no rights.

    Monday, October 1, 2018 3:22 PM

All replies

  • BTW i tried using "/test/results/." like I use for the linux container-on-windows version of this script and it gives me the same error.

    This posting is provided "as is" and confers no rights.

    Monday, October 1, 2018 3:37 PM
  • Greetings,

    Have you tried COPY . . in Dockerfile?


    Sic Parvis Magna

    Tuesday, October 2, 2018 6:08 AM
  • COPY is for  constructing the image, I need to get files that are generated by the test run off the image after it runs. I tried using -v to mount the local folder as a volume in the container but that presented problems in the LCOW environment where the dotnet test engine couldn't write the TRX files to the mounted folder for some reason.

    I am very much trying to use the same dockerfile  and powershell script for both Linux-on-LCOW-ServerCore and Windows-on-Windows dotnet SDK containers .


    This posting is provided "as is" and confers no rights.

    Tuesday, October 2, 2018 12:55 PM
  • Greetings,

    "I need to get files that are generated by the test run off the image after it runs"

    Will multi-stage builds help you a little here?

    https://docs.docker.com/develop/develop-images/multistage-build/


    Sic Parvis Magna

    Wednesday, October 3, 2018 1:42 AM