Docker includes invalid characters for a local volume name

旧时模样 提交于 2020-02-25 04:14:06

问题


I want to install OSRM locally using the docker container under windows

I followed the steps in this doc

In the end I can not execute the necessary commands and I receive the following error :

Any suggestion will be very helpful for me, thank you !


回答1:


seems like the window command prompt does not interpret $PWD, you have to use gitbash or powershell I think. or another option is to use full path or current path.

The flag -v "${PWD}:/data" creates the directory /data inside the docker container and makes the current working directory "${PWD}" available there. The file /data/berlin-latest.osm.pbf inside the container is referring to "${PWD}/berlin-latest.osm.pbf" on the hos




回答2:


Path expansion is different in each shell.

For PowerShell use: ${pwd} 

For cmd.exe "Command Prompt" use: %cd%

bash, sh, zsh, and Docker Toolbox Quickstart Terminal use: $(pwd) 

Note, if you have spaces in your path, you'll usually need to quote the path.

Also answered here: Mount current directory as a volume in Docker on Windows 10



来源:https://stackoverflow.com/questions/58557345/docker-includes-invalid-characters-for-a-local-volume-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!