So I need help to get this clarified:
Docker toolbox (
docker.exe) has issues to with windows paths in the
ISSUE -> RESULT
- colon “
:” do not work -> no other drive then C possible
- spaces “
” do not work -> no default windows folders are possible (Program Files, …)
- backslashes “
\” do not work -> no shell/env-variables for paths are possible
- no relative path gets resolved “
./..” -> absolute path wanted
-> Kitematic dies the same death on those Paths.
D:\Github Projects\Testproject 1\>docker.exe -p 8000:80 -v "%cd%\www":/app --name "Test Project1" bananaacid/docker-php7.2-kitematic
resulting in, but not accepted:
docker.exe -p 8000:80 -v "D:\Github Projects\Testproject 1\www":/app --name "Test Project1" bananaacid/docker-php7.2-kitematic
Same issue on
cmd.exe as well as
--volume is actually not usable on windows? Or is there any workaround vor all these problems?
edit (partial solution: for drive and backslashes, not spaces):
since docker is using cygwin internally, all paths have to be converted to cygwin paths (
$(pwd) is powershell inserting the current path, executing
$(& ...cygpath "..currentpath..") for docker to get a unix path:
docker run -p 8000:80 -p 8443:443 --volume "$(& "C:\Program Files\Git\usr\bin\cygpath.exe" "$(pwd)\www")":/app --name TestProject1 bananaacid/docker-php7.2-kitematic
which does in fact substitute correctly, but the space is still not accepted. A path without a space would work. Result so far:
/d/Github Projects/Testproject 1/www/
Manually escaping the space with a backspace, does not work either:
--volume "/d/Github Projects/Testproject 1/www/":/app
--volume "/d/Github\ Projects/Testproject\ 1/www/":/app
--volume /d/Github\ Projects/Testproject\ 1/www/:/app
--volume "/d/Github Projects/Testproject 1/www/:/app"
docker-compose does do resolve
volumes: - ./..:/app
docker inspect shows the mounts with correct path, but VOLUMES is still not being set.
-> no solution yet.