I am trying to run a very simple python file that simply prints "woof" within a docker container. As far as I know I have created a docker container called:
c5d3c4c383d1
I then run the following command, in an attempt to tell myself what directory I am running things from in docker:
sudo docker run c5d3c4c383d1 pwd
This returns the following value:
/
Which I assume to be my root directory, so I go to my root directory. Typing pwd shows:
/
I then create a file called meow.py via the nano command and enter in this a single line that is:
print("Woof!")
I save this and confirm this is in the / directory with an ls command.
I then enter the following:
sudo docker run c5d3c4c383d1 python meow.py
Which returns:
python: can't open file 'meow.py': [Errno 2] No such file or directory
I don't understand this. Obviously I am not in the root directory when running a command with the docker as the meow.py file is DEFINETLY in the root directory but it is saying this file cannot be found. What the heck... As i said when I run pwd within the docker container it says i am in the / directory, but I cannot be given this file not found error.