mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-22 09:31:58 -05:00
issue: Make image arbitrary-UID friendly (OpenShift/Restricted SCC): writable HOME + group-writable app/data dirs #6082
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SebLz on GitHub (Aug 13, 2025).
Check Existing Issues
Installation Method
Other
Open WebUI Version
v0.6.22
Ollama Version (if applicable)
No response
Operating System
RHEL / OpenSHift
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Summary
Running the official
ghcr.io/open-webui/open-webuiimage on OpenShift with the restricted SCC fails when the app (or Python libs like transformers/tiktoken) try to write outside/app/backend/data(e.g., to$HOMEor cache dirs). OpenShift injects a random non-root UID (e.g.,1000790000) and supplemental group 0, so any path not group-writable by GID 0 becomes read-only. The image mostly works because/app/backend/datais writable, but$HOMEand other paths under/appdefault toroot:root 755.This is a standard “arbitrary UID” compatibility issue. A small Dockerfile hardening (least privilege) fixes it without breaking existing usage and improves security by avoiding reliance on a fixed user.
A very similar fix was recently implemented for LiteLLM: https://github.com/BerriAI/litellm/issues/13208
Environment
ghcr.io/open-webui/open-webui(e.g., v0.6.18)/app/backend/dataObserved inside the running pod
/app/backend/datais correctly group-writable (works).$HOME=/root) areroot:root 755→ permission denied when libraries write caches there.ex:
ERROR [root] An error occurred: [Errno 13] Permission denied: '/app/backend/open_webui/static/apple-touch-icon.png'Expected
Actual
/app/backend/datafail with EACCES unless users rebuild or wrap the container.Root cause
OpenShift injects a random UID and keeps GID 0 as a supplemental group. If the image’s writable paths are group-owned by 0 and g+rwX, it “just works.” Today, the image sets many files to
root:root 755, so$HOMEand some caches are not writable.Proposed fix (minimal, backwards-compatible)
Make the image arbitrary-UID friendly:
/appand/rootare group 0 and group-writable.USERin the final image; let the platform (OpenShift restricted SCC) inject a safe UID at runtime.Dockerfile patch (unified diff)
Notes on compatibility/security
USERprevents conflicts with OpenShift’sMustRunAsRangeand is the standard way to support arbitrary UIDs.g+skeeps new files in group 0, so subsequent restarts/new random UIDs continue to have write access.(Optional) Nice-to-have: writable HOME on PVC
If you want to be even stricter about not touching
/root, you can set:This keeps all caches under the mounted data volume. (The current image already exposes cache env vars like
HF_HOME,SENTENCE_TRANSFORMERS_HOME,TIKTOKEN_CACHE_DIR, etc., so this is mostly a quality-of-life improvement.)Ask
Merge the Dockerfile changes above (or equivalent) so the image is arbitrary-UID compatible out of the box.
Optionally document an “OpenShift / Restricted SCC” section that mentions:
USERin imageg+rwXon/app,/root, and/app/backend/dataHOME=/app/backend/data/homeActual Behavior
cf. above
Steps to Reproduce
cf. above
Logs & Screenshots
cf. above
Additional Information
No response
@tjbck commented on GitHub (Aug 13, 2025):
PR welcome