Search notes:

docker run -volume

docker run -volume hostPath:imagePath allows to access a host directory or file from the file system of a Docker container.
It it important to specify the -v option before the image name. The following command line results in the error message docker: Error response from daemon: container … encountered an error during CreateProcess: The system cannot find the file specified.
C:\> docker run -it mcr.microsoft.com/windows:1809 -v c:\Users\Rene:c:\host-files
Better is:
C:\> docker run -v c:\Users\Rene:c:\host-files -it mcr.microsoft.com/windows:1809
A path can also be mounted (if this is the correct terminology) read-only:
C:\> docker run -v c:\Users\Rene:c:\host-files:ro -it mcr.microsoft.com/windows:1809

See also

docker cp

Index