Docker Community Forums

Share and learn in the Docker community.

Docker: PermissionError: [Errno 13] Permission denied: '/app/app.py'

Issue : I am using Docker(Linux Container) on Windows 10 Pro. I created a docker build for the flask application.After i run the application i get the PermissionError: [Errno 13] Permission denied: ‘/dir/app.py’

docker version

Client: Docker Engine - Community
Version: 18.09.2
API version: 1.39
Go version: go1.10.8
Git commit: 6247962
Built: Sun Feb 10 04:12:31 2019
OS/Arch: windows/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.2
API version: 1.39 (minimum version 1.12)
Go version: go1.10.6
Git commit: 6247962
Built: Sun Feb 10 04:13:06 2019
OS/Arch: linux/amd64
Experimental: false

I get similar error while trying the post below, so below post can be used to reproduce the error

https://runnable.com/docker/python/docker-compose-with-flask-apps

Additional information
Error log
Traceback (most recent call last):
web_1 | File “app.py”, line 15, in
web_1 | app.run(host=“0.0.0.0”, debug=True)
web_1 | File “/usr/local/lib/python2.7/site-packages/flask/app.py”, line 943, in run
web_1 | run_simple(host, port, self, **options)
web_1 | File “/usr/local/lib/python2.7/site-packages/werkzeug/serving.py”, line 988, in run_simple
web_1 | run_with_reloader(inner, extra_files, reloader_interval, reloader_type)
web_1 | File “/usr/local/lib/python2.7/site-packages/werkzeug/_reloader.py”, line 332, in run_with_reloader
web_1 | sys.exit(reloader.restart_with_reloader())
web_1 | File “/usr/local/lib/python2.7/site-packages/werkzeug/_reloader.py”, line 176, in restart_with_reloader
web_1 | exit_code = subprocess.call(args, env=new_environ, close_fds=False)
web_1 | File “/usr/local/lib/python2.7/subprocess.py”, line 172, in call
web_1 | return Popen(*popenargs, **kwargs).wait()
web_1 | File “/usr/local/lib/python2.7/subprocess.py”, line 394, in init
web_1 | errread, errwrite)
web_1 | File “/usr/local/lib/python2.7/subprocess.py”, line 1047, in _execute_child
web_1 | raise child_exception
web_1 | OSError: [Errno 13] Permission denied