I want to write a cmd in docker file to copy the file at the destination C:\windows\Program Files. I am having an issue due to space in program files. I am able to copy the file to different location. Any suggestion will be appreciated.
I am getting below error:
Step 4 : COPY "C:\docker\prerequisites\MicrosoftSDKs" "C:\Program Files
(x86)\MicrosoftSDKs"
Forbidden path outside the build context: C:\docker\prerequisites\MicrosoftSDKs
()
解决方案
Use the JSON form, you have to use double backslashes inside the braces
FROM microsoft/windowsservercore
COPY ["C:\\docker\\prerequisites\\MicrosoftSDKs", "C:\\Program Files (x86)\\MicrosoftSDKs"]
You can also use slash:
COPY ["C:/Program Files/nodejs", "/windows/system32"]