Looking for a quick solution to copy local files to a Docker container on Windows. I wasn't able to find this in other Stack Overflow solutions.
You might call this mounting a local drive on Windows within a docker container.
Description. The docker cp utility copies the contents of SRC_PATH to the DEST_PATH . You can copy from the container's file system to the local machine or the reverse, from the local filesystem to the container.
Open the Docker settings from the icon on the taskbar:
Go to 'Shared Drives' and enable your local drive to be made accessible to your containers:
Now you can add folders from your shared drive as a volume in a container. Using the nginx
example from the Docker getting started guide:
docker run -it -v c:/Users:/data nginx /bin/bash
That will give you shell access, where you can find your local files (c:/Users) in the /data directory of your nginx container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With