2

I'm trying to use Docker on Windows through Docker Toolbox, but I'm struggling to make it work. I've pulled Docker PHP image. For example, this simple ls command fails:

$ docker run -it --rm -v /$(pwd):/home/projects php:7.0-cli ls -l /home/projects
ls: cannot open directory /home/projects: Operation not permitted

Also, any other operation within the mounted volume fails with Operation not permitted message.

Nikola Poša
  • 153
  • 1
  • 1
  • 13

1 Answers1

0

Looks like a path issue with the volume mapping. Docker Toolbox uses Git Bash for the terminal, which uses /c as the root of the C: drive:

$ echo $(pwd)
/c/Users/elton

So your /$(pwd) is prepdening an extra forward slash. I'd try with a fully-qualified path first just to verify:

$ docker run -it --rm -v /c/projects:/home/projects php:7.0-cli ls -l /home/projects
Elton Stoneman
  • 17,906
  • 5
  • 47
  • 44