Docker Community Forums

Share and learn in the Docker community.

Issue running helloworld python app

I am new to Docker. Please provide me help on the following:
I have below pythan file: -----------

from flask import Flask
app = Flask(name)
def hello():
return “hello world!”

if name == “main”:“”)

DockerFile have bellow contents:
----------DockerFile ------------
FROM python:3.6.1-alpine
RUN pip install flask
CMD [“python”,“”]

I run below command. It works fine.
PS C:\Windows\system32\temp> docker image build -t python-hello-world .

PS C:\Windows\system32\temp> docker images
python-hello-world latest 45191f1cc94c 2 hours ago 98.5MB

PS C:\Windows\system32\temp> docker run -p 6001:6000 -d python-hello-world

Here is the failuer.
I tried google but can not find out how to fix it.

PS C:\Windows\system32\temp> docker ps -a
fe4763977bff python-hello-world “python /” 8 minutes ago Exited (1) 8 minutes ago

PS C:\WINDOWS\system32\temp> docker container logs fe4763977bff
File “”, line 1
SyntaxError: Non-UTF-8 code starting with ‘\xff’ in file on line 1, but no encoding declared; see for details