Docker image error: "/bin/sh: 1: [python,: not found" Docker image error: "/bin/sh: 1: [python,: not found" python python

Docker image error: "/bin/sh: 1: [python,: not found"


I have resolved my issue on my Mac by changing

CMD ["python", "app.py"]

to

CMD python app.py


I had the same error. But in my case it was syntax error in command.
I had a missing comma ","
CMD ["python" "app.py"]
instead of
CMD ["python", "app.py"]

Validating the yaml file format can help in this case. Can use any online yaml validator.