I am trying to map a volume for C:\ProgramData. Unfortunately, Docker only gives a very generic message:
Error response from daemon: invalid volume specification: 'C:\ProgramData\Microsoft\VisualStudio:C:\ProgramData\Microsoft\VisualStudio:ro
Option:
-v "C:\ProgramData\Microsoft\VisualStudio":"C:\ProgramData\Microsoft\VisualStudio":ro
It worked before, then I made some modifications to the Dockerfile, and it doesn't any more.
Does anyone have any idea?
Details
The mapping actually works on my local machine, but not in Azure DevOps, where I am using the created image for compiling some code.
The previous set of options, where it worked, was -v ... -v ... --mount src=..,dst=..,,type=bind,readonly. But I needed to change --mount to -v, because it had to be a volume.
The directory exists on the Azure agent, I checked.
For the critics - this is the way to reduce the image size. Create a volume e.g. under C:\Program Files, install a program (during the build phase) - and it's not taking any space in the actual image. But as all registry entries are correct, map the same directory on the agent - and the program is as good as installed inside the image. Except for this stopped working...