From 49b55fcb2a03a86f525a82912f75b8c9363724d2 Mon Sep 17 00:00:00 2001 From: Thiago Margatho Date: Wed, 22 Jul 2026 08:40:11 -0300 Subject: [PATCH] fix(docker): chown ~/.cache so the app user can write caches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docker creates /home/voicebox/.cache (parent of the huggingface-cache volume mountpoint) owned by root on every container create, and a fresh named volume is root-owned too. The app runs as the voicebox user (uid 999), so anything that writes a cache outside the HF mount (torch hub, spacy, ...) fails with Permission denied. The entrypoint already runs as root before dropping privileges via gosu — create/chown the cache dirs there (non-recursive, instant). Co-Authored-By: Claude Fable 5 --- scripts/rocm-entrypoint.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/rocm-entrypoint.sh b/scripts/rocm-entrypoint.sh index 6f3965e4..73812e1b 100644 --- a/scripts/rocm-entrypoint.sh +++ b/scripts/rocm-entrypoint.sh @@ -12,4 +12,10 @@ for dev in /dev/kfd /dev/dri/render*; do } usermod -aG "$grp" voicebox done +# Docker creates the HF volume mountpoint's parent (~/.cache) as root on every +# container create, and a fresh volume is root-owned too — without this the app +# user can't write any cache (torch, spacy) outside the HF mount. +mkdir -p /home/voicebox/.cache/huggingface +chown voicebox:voicebox /home/voicebox/.cache /home/voicebox/.cache/huggingface + exec gosu voicebox "$@"