Enter the text:
Traceback (most recent call last):
File "caesarCipher.py", line 16, in <module>
text=input("Enter the text: ")
EOFError: EOF when reading a line
how can I fix this ? Thank you
You should run your container with the -it flags (interactive terminal). This will allow you to interact with the process running inside the container.
For example:
foo.py
x = input('Enter some input: ')
print(x)
Dockerfile
from python
COPY foo.py .
ENTRYPOINT python foo.py
Usage
$ docker build . -t foo
$ docker run -it foo
Enter some input: foo
foo
$
I guess the problem that you defined your script to be the entrypoint of your container. Inside the script the input function expects to have either a tty or a stream.
Running the script inside the container like this will do the trick:
docker run -it your_docker_container /path/to/your/script.py
-tiarguments.