Docker Community Forums

Share and learn in the Docker community.

Mapping drives doesn't work

This is my introduction to Docker, I have installed Docker Toolbox 18.03 on a Windows 7 (64-bit)

That worked OK
I can run these commands without issue:
docker run --rm -it -v (pwd):/src python:3 python docker run --rm -it -v (pwd):/src python:3 /bin/bash

But, the mapping isn’t really working
When I run this simple Python script, it can’t find the file:
docker run --rm -v $(pwd):/src python:3 python /src/hello.py

It states
python: can’t open file ‘/src/hello.py’: [Errno 2] No such file or directory

Now, I have the directory setup … but it is empty:
root@7d37b736afe4:/# df -k
Filesystem 1K-blocks Used Available Use% Mounted on
overlay 18714044 1279040 16445876 8% /
tmpfs 65536 0 65536 0% /dev
tmpfs 506548 0 506548 0% /sys/fs/cgroup
tmpfs 911792 235052 676740 26% /src
/dev/sda1 18714044 1279040 16445876 8% /etc/hosts
shm 65536 0 65536 0% /dev/shm
tmpfs 506548 0 506548 0% /proc/asound
tmpfs 506548 0 506548 0% /proc/acpi
tmpfs 506548 0 506548 0% /proc/scsi
tmpfs 506548 0 506548 0% /sys/firmware
root@7d37b736afe4:/#

Before starting up, I think all is OK
myuser@mymachine MINGW64 /x/docker
$ pwd
/x/docker

myuser@mymachine MINGW64 /x/docker
$ cat hello.py
print(‘hello’)

myuser@mymachine MINGW64 /x/docker
docker run --rm -v (pwd):/src python:3 python /src/hello.py
python: can’t open file ‘/src/hello.py’: [Errno 2] No such file or directory

myuser@mymachine MINGW64 /x/docker
$

Why can’t it find that file ?

So, something’s wrong … I guess I should start guessing

Seems like half of the threads don’t even get 1 reply