Skip to content

Fix Docker startup failure: set writable home directory for app user#1

Merged
Eoic merged 2 commits intomasterfrom
copilot/fix-docker-container-issue
Feb 17, 2026
Merged

Fix Docker startup failure: set writable home directory for app user#1
Eoic merged 2 commits intomasterfrom
copilot/fix-docker-container-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

Container crashes on startup because adduser --system defaults to home dir /nonexistent. HuggingFace Hub tries to cache the sentence-transformer model at $HOME/.cache/huggingface/, which fails with PermissionError.

  • Set --home /home/app on adduser so the user gets a real, writable home directory
# Before
RUN addgroup --system app && adduser --system --ingroup app app

# After
RUN addgroup --system app && adduser --system --home /home/app --ingroup app app

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • huggingface.co
    • Triggering command: /home/REDACTED/.local/bin/pytest pytest -v (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… app user

The container was failing because `adduser --system` creates a user with home
directory `/nonexistent` by default. HuggingFace Hub tries to cache model files
at `$HOME/.cache/huggingface/`, which fails with PermissionError.

Adding `--home /home/app` creates a proper writable home directory for the user.

Co-authored-by: Eoic <18404082+Eoic@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix issue running Docker container on production Fix Docker startup failure: set writable home directory for app user Feb 16, 2026
Copilot AI requested a review from Eoic February 16, 2026 18:59
@Eoic Eoic marked this pull request as ready for review February 17, 2026 07:44
Copilot AI review requested due to automatic review settings February 17, 2026 07:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a container startup crash by ensuring the non-root app user has a real, writable home directory, which is required for HuggingFace Hub model caching.

Changes:

  • Update adduser invocation to set the app user’s home directory to /home/app.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Eoic Eoic merged commit 6e4eb2a into master Feb 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants