1

I am using docker toolbox v17.03 in Windows 10 Home. I am playing with flask app from python slim. I tried to mount the current directory to app and tried ${PWD} and %cd% like below.

docker container run -it  -p 5000:5000 -e FLASK_APP=app.py --rm -e FLASK_DEBUG=1 -v %cd%:/app web1

==> Got the error saying invalid characters

docker container run -it  -p 5000:5000 -e FLASK_APP=app.py --rm -e FLASK_DEBUG=1 -v ${PWD}:/app web1

==> Neither error nor working

jprism
  • 3,239
  • 3
  • 40
  • 56

1 Answers1

1

The second form ${PWD} would be working in a Powershell session.

If it still says "invalid characters", that means:

  • the %cd% is not resolved as an absolute path
  • it includes characters that are not in [a-zA-Z0-9][a-zA-Z0-9_.-], making it inelligible for a volume name.

Double-check what %cd% returns, and if there is any special non-ascii character in it (or spaces)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250