简体   繁体   中英

Docker includes invalid characters “${PWD}” for a local volume name

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 !

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

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

pwd is a linux command to get the current path, you need to set the full path in windows, i am not sure about %cd% you may try it

I have no windows to test, but maybe this will work: set a varibale named PWD

SET PWD="C:/bla/bla"

and then run your command without {}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM