Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] permission denied for shared directory in the container when no volume was mounted #1373

Closed
przemyslavic opened this issue Jun 19, 2020 · 0 comments · Fixed by #1378
Closed
Assignees
Labels

Comments

@przemyslavic
Copy link
Collaborator

Describe the bug
Assuming I want to run everything in the container without mounting any volume, there is an issue with permissions.
The shared directory is owned by root and therefore epicli can not write anything in it.

To Reproduce
Steps to reproduce the behavior:

  1. execute docker run -it image:tag
  2. execute epicli init -p aws -n xxx

Expected behavior
Configuration file has been generated and saved in the shared directory.

Additional context

Command output

epiuser@60d68dc3d233:/shared$ epicli init -p aws -n xxx
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/cli/epicli.py", line 126, in main
    return args.func(args)
  File "/usr/local/lib/python3.7/site-packages/cli/epicli.py", line 147, in run_init
    with InitEngine(args) as engine:
  File "/usr/local/lib/python3.7/site-packages/cli/engine/InitEngine.py", line 16, in __init__
    super().__init__(__name__)
  File "/usr/local/lib/python3.7/site-packages/cli/helpers/Step.py", line 8, in __init__
    self.logger = Log(step_name)
  File "/usr/local/lib/python3.7/site-packages/cli/helpers/Log.py", line 33, in __new__
    Log.instance = Log.__LogBase()
  File "/usr/local/lib/python3.7/site-packages/cli/helpers/Log.py", line 17, in __init__
    log_path = os.path.join(get_output_path(), config.log_file)
  File "/usr/local/lib/python3.7/site-packages/cli/helpers/build_saver.py", line 76, in get_output_path
    os.makedirs(Config().output_dir)
  File "/usr/local/lib/python3.7/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/shared/build/'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/epicli", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/cli/epicli.py", line 128, in main
    logger = Log('epicli')
  File "/usr/local/lib/python3.7/site-packages/cli/helpers/Log.py", line 33, in __new__
    Log.instance = Log.__LogBase()
  File "/usr/local/lib/python3.7/site-packages/cli/helpers/Log.py", line 17, in __init__
    log_path = os.path.join(get_output_path(), config.log_file)
  File "/usr/local/lib/python3.7/site-packages/cli/helpers/build_saver.py", line 76, in get_output_path
    os.makedirs(Config().output_dir)
  File "/usr/local/lib/python3.7/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/shared/build/'

drwxr-xr-x 2 root root 4096 Jun 18 12:54 shared

@rafzei rafzei self-assigned this Jun 23, 2020
rafzei added a commit to rafzei/epiphany that referenced this issue Jun 23, 2020
@rafzei rafzei linked a pull request Jun 23, 2020 that will close this issue
rafzei added a commit to rafzei/epiphany that referenced this issue Jun 23, 2020
rafzei added a commit that referenced this issue Jun 25, 2020
* Docker image user permissions fix (#1373) + got rid of empty continuation line warning

* Add reference to env var provided in Dockerfile

* Add build dir for backward compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants