3

I was trying to run django app on docker container. Followed steps mentioned at https://docs.docker.com/compose/django/ But after running the command docker-compose run web django-admin.py startproject composeexample . I facing error PermissionError: [Errno 13] Permission denied: '/code/manage.py' I'm using centos 7. please help

[root@localhost docker-django]# docker-compose run web django-admin.py startproject composeexample .
Traceback (most recent call last):
  File "/usr/local/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", line 393, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", line 444, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/commands/startproject.py", line 33, in handle
    super(Command, self).handle('project', project_name, target, **options)
  File "/usr/local/lib/python3.4/site-packages/django/core/management/templates.py", line 154, in handle
    with open(new_path, 'wb') as new_file:
PermissionError: [Errno 13] Permission denied: '/code/manage.py'
Raja Sekhar
  • 51
  • 2
  • 5

2 Answers2

1

The problem was with SELinux enabled on centos 7. It worked here.

Raja Sekhar
  • 51
  • 2
  • 5
0

There is a pending upstream issue issue 1842 and issue 1936.

PR 1843 for the first one will get you somewhere but it's not ok long term or prod.

Please monitor them and you will get a correct answer

Fuxi
  • 5,298
  • 3
  • 25
  • 35