I’m using Docker Toolbox on Windows, since I can’t use Docker for Windows on my machine. My issue is with the following command:
docker container run -it --rm -v database_mongodb_data:/data/db -v $(pwd):/backup ubuntu bash
With the second
-v flag, I want to bind my current working directory to the container as a volume, to copy some data from the host machine into the container. The PWD is located under C://Users/…, it contains a number of files, and I made sure that my Docker Quickstart Terminal is cd’d to that directory. The container runs fine, it has the
/backup directory, but that directory is empty.
This is a fresh install of Docker Toolbox (v18.09.3), on Windows 10. I use the above command in a script, which I’ve been using on older installations for the last couple of months, without a problem. Does anyone have an idea what the matter might be?
Edit: when I run this command directly under
C://Users/myname, the container’s
/backup directory can see one of the folders in my host’s “home”, but only one. It can also see one subfolder of that, and one subfolder of the subfolder, but that’s it. It doesn’t see all the directories, and none of the files. Could this be a permission problem?
Edit 2: The same thing stated in the first edit is also true when I SSH into the docker-machine and cd into
/c/Users/myname. The machine sees one directory in there, with one sub- and one sub-subdirectory, but nothing more, and no files.