I am trying to do volume mapping from linux container to my local windows machine.
Here are the steps:
- Installed latest version of Docker desktop for windows (2.4.0.0) and it's currently using WSL2 based engine.
- Started a container using my own image on top of alpine image. Working directory is set to '/app' in linux container.
- An output file (Report.html) is created under a folder (Reports) in my linux container once it is run. Able to view the file in container.
- I would like to save the output file to a folder named 'Output' under my user directory in local windows machine.
Ran the following command in Power Shell in Admin mode:
docker run -it -v ~/Output:/app/Reports <imagename>
Issue: Output file (Report.html) does not get copied to Output folder in local machine.
Note: I don't see the option to select drive for file sharing in Docker settings.
Please guide me on how I can resolve this ?
Using absolute path in place of ~ worked, i.e. docker run -v C:/Users/12345/Output:/app/Reports