Mounting a directory from the host in boot2docker for Windows

Solution 1:

If you want to mount the $APPDATA on your Windows host machine to /datadir on the docker container, instead of the below command:

docker run -d --name abe -v $APPDATA/Bitcoin:/datadir poliver/bitcoin-abe

You can issue:

docker run -d --name abe -v //c/Users/YOUR_USER_NAME/$APPDATA/Bitcoin:/datadir poliver/bitcoin-abe

//c/Users/PATH_TO_DIR is the key here for Windows directory

Your $APPDATA Directory MUST reside on the /c/Users/Your_User_Name directory and it cannot reside on other places. (e.g. D:/$APPDATA on the D partition.)

Solution 2:

see: https://github.com/docker/docker/issues/12590

If you're using git bash on windows, msysgit converts paths like /c/users to c:\users (not something you want because the path inside the boot2docker VM is /c/Users)

On cmd.exe/powershell you shouldn't be having this problem.