Docker卷-必须是Windows的绝对路径(路径与指定的路径不同)

时间:2019-08-08 14:54:21

标签: bash docker docker-volume

我正在尝试从命令行运行带有卷的容器,但它一直告诉我我需要一个绝对路径,但引用的路径与指定路径不同:

$ winpty docker run -it --rm --name php-runner -v C:\Users\ronaldg\Desktop\learning\docker\tutorials\willitscale\tut3\src:/usr/src/myapp -w /usr/src/myapp php:7.2-cli php run.php

C:/Program Files/Docker/Docker/Resources/bin/docker.exe: Error response from daemon: the working directory 'C:/Users/ronaldg/AppData/L
ocal/Programs/Git/usr/src/myapp' is invalid, it needs to be an absolute path.


$ winpty docker run -it --rm --name php-runner -v c/usr/mnt/c/users/ronaldg/Desktop/learning/docker/tutorials/willitscale/tut3/src:/usr/src/myapp -w /usr/src/myapp php:7.2-cli php run.php

C:/Program Files/Docker/Docker/Resources/bin/docker.exe: Error response from daemon: Mount denied:
The source path "c\\usr\\mnt\\c\\users\\ronaldg\\Desktop\\learning\\docker\\tutorials\\willitscale\\tut3\\src;C"
is not a valid Windows path.


$ docker run --rm --name php-runner -v //c:/usr/mnt/c/users/ronaldg/Desktop/learning/docker/tutorials/willitscale/tut3/src:/usr/src/myapp -w /usr/src/myapp php:7.2-cli php run.php

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: the working directory 'C:/Users/ronaldg/AppData/Local/Programs/Git/usr/src/myapp' is invalid, it needs to be an absolute path.


$ winpty docker run –it --rm php-runner –v c:\Users\ronaldg\Desktop\learning\docker\tutorials\willitscale\tut3\src:/usr/src/myapp -w /usr/src/myapp php:7.2-cli php run.php

C:/Program Files/Docker/Docker/Resources/bin/docker.exe: invalid reference format.

我到底在做什么错?我在Windows计算机上使用bash(MINGW64)。

0 个答案:

没有答案