How to copy files from local machine to docker container on windows

Manou picture Manou · Oct 28, 2016 · Viewed 76.5k times · Source

I have to import data files from a user local file C:/users/saad/bdd to a docker container (cassandra), I didn't find how to proceed using docker commands. I'm working on windows 7.

Many thanks for your help

Answer

Alvaro Carvajal picture Alvaro Carvajal · Oct 29, 2016

Use docker cp.

docker cp c:\path\to\local\file container_name:/path/to/target/dir/

If you don't know what's the name of the container, you can find it using:

docker ps --format "{{.Names}}"