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

Set Home Directory for 'app' User in Dockerfile #382

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

th3happybit
Copy link
Contributor

Set Home Directory for 'app' User in Dockerfile:

  • fixes issue related to nonexistent default home directory, addressing permission errors during container runtime.
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/pathlib.py", line 1312, in mkdir
    os.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/.config/shell_gpt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/pathlib.py", line 1312, in mkdir
    os.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/.config'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/sgpt", line 5, in <module>
    from sgpt import cli
  File "/usr/local/lib/python3.12/site-packages/sgpt/__init__.py", line 1, in <module>
    from .app import main as main
  File "/usr/local/lib/python3.12/site-packages/sgpt/app.py", line 9, in <module>
    from sgpt.config import cfg
  File "/usr/local/lib/python3.12/site-packages/sgpt/config.py", line 83, in <module>
    cfg = Config(SHELL_GPT_CONFIG_PATH, **DEFAULT_CONFIG)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/sgpt/config.py", line 49, in __init__
    config_path.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.12/pathlib.py", line 1316, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.12/pathlib.py", line 1316, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/local/lib/python3.12/pathlib.py", line 1312, in mkdir
    os.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/nonexistent'

… to nonexistent default home directory, addressing permission errors during container runtime.
@TheR1D TheR1D added docker Docker related bug Something isn't working labels Dec 11, 2023
@TheR1D TheR1D merged commit a9bebab into TheR1D:main Dec 11, 2023
3 checks passed
@TheR1D
Copy link
Owner

TheR1D commented Dec 11, 2023

Hi @th3happybit thank you for fixing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docker Docker related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants