mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-10 15:54:15 -05:00
Add Ability to run rootless Docker Container with custom UID and GUID #1616
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 @wggcch on GitHub (Jul 26, 2024).
Is your feature request related to a problem? Please describe.
When mounting the document volume for document scan, the documents and folders are owned by root. This can be problematic when I want to delete scanned documents within the Docker volume itself. Having root ownership restricts the ability to manage these files easily and can lead to permission issues.
Describe the solution you'd like
I would suggest running the Docker container with a custom User ID and Group ID. By specifying a non-root user, it will ensure that the files and folders created within the volume are owned by this user, thus avoiding permission issues and making it easier to manage the scanned documents directly from the host.
Additional context
To implement this feature, the Dockerfile should be modified to accept custom User ID and Group ID as build arguments, and the container should run with these IDs. Additionally, the Docker run command or script should be adjusted to use these custom IDs. This will improve security and ease of file management within the mounted volume.
Example Dockerfile changes:
Implementing this feature will greatly enhance the usability and security of the Docker setup for document scanning processes. Thank you for considering this request.
@damajor commented on GitHub (Jul 26, 2024):
I use podman rootless and I never had an issue.
Could you explain how you start your container ?
@wggcch commented on GitHub (Jul 26, 2024):
Hi @damajor,
We start it within a custom docker compose file, where we added multiple services
(including openwebui, pipelines ollama and so on)
and mount the /documents dir
So by this method the /volumne dir by default is root owned
and then we just run docker compose up -d
@damajor commented on GitHub (Jul 26, 2024):
Well I switched to podman to replace docker everywhere so I don't have to mess with such things and I can run any stack as a user, nothing is running as root.
In case of escape, the container root is mapped to the running local user.
Sorry I cant help more.