I have a very simple python script. I am trying to use it in a docker container.
Python file (computer.py)
import datetime
print("Welcome to virtual assistant.")
name = input("What is your name? ")
print("Welcome " + name)
def time():
print(datetime.datetime.now())
command = input("Would you like to know the time " + name + "?")
if command == "yes":
print(time())
And My docker file looks like this.(Docker)
FROM python:3
ADD computer.py /
CMD [ "python", "./computer.py" ]
Then I ran
docker build -t python-barcode .
Then
run python-barcode
I get this error
Traceback (most recent call last):
File "./computer.py", line 4, in <module>
name = input("What is your name? ")
EOFError: EOF when reading a line
Welcome to virtual assistant.
What is your name? %
It seems to run the code up untill I ask for input? Not even sure what would cause that. Any help would be greatly appreciated.