Using absolute path with docker run command not working

docker

Solution

To close the subject. Here is the solution ;) docker toolbox mount file on windows

Also, the interpolation of $HOME by docker on windows have to be compatible with it, so it should transform it by himself when you call it in docker command.

Problem

What's the difference between these two docker run commands and why one is working and the other does not. Working Command `docker run --publish=7474:7474 --volume=$HOME/neo4j_test/data:/data neo4j` Not Working `docker run --publish=7474:7474 --volume=C:/Users/USERNAME/neo4j_test/data:/data neoj` `docker run --publish=7474:7474 --volume=C:\Users\USERNAME\neo4j_test\data:/data neo4j` Error for these commands C:\Program Files\Docker Toolbox\docker.exe: Error response from daemon: Invalid bind mount spec "C:UsersUSERNAMEneo4j_testdata:/data": invalid mode: /data. See 'C:\Program Files\Docker Toolbox\docker.exe run --help'. In the non-working commands, I just replaced `$HOME` with the absolute path for my user profile folder `C:/Users/USERNAME` UPDATE I did inspect the value for `$HOME` by executing `echo $HOME` on Windows Powershell. And it is in fact `C:\Users\USERNAME`. I also did look at the link that @Titouan Freville has commented. So I used the command `docker run --publish=7474:7474 --volume=/c/Users/USERNAME/neo4j_test/data:/data neo4j` isntead of `docker run --publish=7474:7474 --volume=C:/Users/USERNAME/neo4j_test/data:/data neoj` and it is working now. Right now I'm just wondering where the transformation of `$HOME` from `C:\Users\USERNAME` to `/c/Users/USERNAME` happens

Original source

Related problems