I'm running docker 1.6 and boot2docker
on a Windows 8.1 box. When I use the Boot2Docker Start shortcut, it takes me to a cygwin bash prompt where I can run docker commands natively.
I'm having trouble mounting a directory from my users folder. I've tried:
$ docker run -d --name abe -v $APPDATA/Bitcoin:/datadir poliver/bitcoin-abe
I get the error:
invalid value "C:\\Users\\someone\\AppData\\Roaming/Bitcoin:/datadir"
for flag -v: \Users\someone\AppData\Roaming/Bitcoin:/datadir
is not an absolute path
See 'c:\Program Files\Boot2DockeForWindows\docker.exe run --help'.
I get the same results when I call it these ways:
$ docker run -d --name abe -v "$APPDATA/Bitcoin":/datadir poliver/bitcoin-abe
$ docker run -d --name abe -v "/c/users/someone/AppData/Roaming/Bitcoin":/datadir poliver/bitcoin-abe
$ docker run -d --name abe -v ~/AppData/Roaming/Bitcoin:/datadir poliver/bitcoin-abe
I've also tried:
$ docker run -d --name abe -v ~/APPDATA/Bitcoin:/datadir poliver/bitcoin-abe
And I've gotten the error:
FATA[0000] Error response from daemon: cannot bind mount volume: ~\AppData\Bitcoin volume paths must be absolute.
It seems like cygwin bash is replacing /
with \
and then docker parses the argument passed to -v
and can't accept it.
Best Answer
If you want to mount the
$APPDATA
on your Windows host machine to/datadir
on the docker container, instead of the below command:You can issue:
//c/Users/PATH_TO_DIR
is the key here for Windows directoryYour
$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.)