Hi All,
I have a visual studio project called filewriter written using c++ 17. program is very simple: it accepts input from the user and writes it to a file test.txt stored in a folder called data which sits right next to the exe.
I built an image using the following Dockerfile:
ARG FROM_IMAGE=mcr.microsoft.com`Preformatted text`/windows/servercore:ltsc2019
FROM ${FROM_IMAGE}
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; $verbosePreference='Continue';"]
ARG VS2017=https://aka.ms/vs/15/release/vc_redist.x64.exe
ADD ${VS2017} /vc_redist.exe
COPY \\x64\\Release \\programs
RUN Start-Process -filepath c:\vc_redist.exe -ArgumentList "/install", "/passive", "/norestart", "'/log a.txt'" -PassThru | wait-process
WORKDIR \\programs
ENTRYPOINT ["filewriter.exe"]
And run the container using the following command:
> docker run -it --name myfilewriter -v filewriter_data:c:\programs/data "filewriter:1"
All works well. Problem is I want to add more folders next to the exe (like config for example) however I do not want to create a seperate volume for each folder, therefore I tried mounting the root folder of the exe itself using the following command:
> docker run -it --name myfilewriter -v filewriter_data:c:\programs "filewriter:1"
but I keep getting the following error:
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: container 1cac279217e9c467f8ac0f90661977d78aedd1c540ccc3093434865380f31410 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file specified. (0x2)
[Event Detail: Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF75E079D2B: (caller: 00007FF75E02E13A) Exception(4) tid(394) 80070002 The system cannot find the file specified.
CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess]
Provider: 00000000-0000-0000-0000-000000000000] extra info: {"CommandLine":"filewriter.exe","WorkingDirectory":"C:\\programs","EmulateConsole":true,"CreateStdInPipe":true,"CreateStdOutPipe":true,"ConsoleSize":[50,120]}.
Any help would be greatly appreciated,
Thank you