I'm using docker toolbox. I have a python script "prog1.py" on my Windows host machine located at "D:\Werk\Code\Python". And here is my Dockerfile.
FROM python:3
ADD . /usr/src/app
WORKDIR /usr/src/app
CMD [ "python", "prog1.py"]
And here is a clip from my CLI:
D:\Werk\Code\Python> docker build -t python1 .
Sending build context to Docker daemon 64.51kB
Step 1/4 : FROM python:3
---> 955d0c3b1bb2
Step 2/4 : ADD . /usr/src/app
---> 6fc5184bcfea
Removing intermediate container 89252e9fc17d
Step 3/4 : WORKDIR /usr/src/app
---> 6aa9f12ad078
Removing intermediate container b042591d2069
Step 4/4 : CMD python prog1.py
---> Running in 8406f3c9fb35
---> ecf8ba2e9e0f
Removing intermediate container 8406f3c9fb35
Successfully built ecf8ba2e9e0f
Successfully tagged python1:latest
SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
PS D:\Werk\Code\Python> docker run -it python1
<Expected output of the script>
PS D:\Werk\Code\Python> docker run -it -v /d/Werk/Code/Python:/usr/src/app python1
python: can't open file 'prog1.py': [Errno 2] No such file or directory
When I run the image without binding, it works but when I run it with the bind instruction it shows Erno 2.
What am I doing wrong?