“OSError: [Errno 8] Exec format error” when trying to run simple flask app in a docker container

I hit the same problem (Exec format error, then FileNotFound if I added the shebang).

Adding “RUN chmod 644 app.py” to the Dockerfile fixed it for me, as mentioned here: https://github.com/pallets/werkzeug/issues/1482

Leave a Comment