[PR #2322] [MERGED] feat: optional UID/GID docker build args #7757

Closed
opened 2025-11-11 17:35:05 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/2322
Author: @cheahjs
Created: 5/17/2024
Status: Merged
Merged: 5/17/2024
Merged by: @tjbck

Base: devHead: feat/unsupported-nonroot-images


📝 Commits (1)

  • 1dc8078 feat: optional UID/GID docker build args

📊 Changes

1 file changed (+22 additions, -5 deletions)

View changed files

📝 Dockerfile (+22 -5)

📄 Description

Pull Request Checklist

  • Target branch: Pull requests should target the dev branch.
  • Description: Briefly describe the changes in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests for the changes?
  • Code Review: Have you self-reviewed your code and addressed any coding standard issues?

Description

Adds two new build args  UID and GID to set the user and group ID of the files in container and to run as that user. This is added with a note that non-root configurations are untested.

To build as non-root: docker build --build-arg UID=1000 --build-arg GID=1000 --tag=open-webui:nonroot .

This is a no-op change in the default root configuration, which is why $HOME is still set to /root. We can't switch to nonroot by default, as this breaks existing users (and we have enough support requests around Docker usage as it is already, and we encourage users to setup Watchtower for automatic updates). We also don't build nonroot containers in CI because we're already running into total concurrency quotas on GitHub Actions. Adding a nonroot variant to the build matrix increases the number of tags from 3 to 6, and the total number of images from 6 to 12.

Test docker build: https://github.com/cheahjs/open-webui-fork/actions/runs/9121520626

Addresses https://github.com/open-webui/open-webui/discussions/1698 and https://github.com/open-webui/open-webui/discussions/1021

Prior attempts: https://github.com/open-webui/open-webui/pull/1533 https://github.com/open-webui/open-webui/pull/2316

Tested locally with base, bundled ollama, and CUDA.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/2322 **Author:** [@cheahjs](https://github.com/cheahjs) **Created:** 5/17/2024 **Status:** ✅ Merged **Merged:** 5/17/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `feat/unsupported-nonroot-images` --- ### 📝 Commits (1) - [`1dc8078`](https://github.com/open-webui/open-webui/commit/1dc80786c12155c9792ad91dd7e366b3ccf5a841) feat: optional UID/GID docker build args ### 📊 Changes **1 file changed** (+22 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `Dockerfile` (+22 -5) </details> ### 📄 Description ## Pull Request Checklist - [x] **Target branch:** Pull requests should target the `dev` branch. - [x] **Description:** Briefly describe the changes in this pull request. - [ ] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [ ] **Documentation:** Have you updated relevant documentation [Open WebUI Docs](https://github.com/open-webui/docs), or other documentation sources? - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? - [x] **Testing:** Have you written and run sufficient tests for the changes? - [x] **Code Review:** Have you self-reviewed your code and addressed any coding standard issues? --- ## Description Adds two new build args  `UID` and `GID` to set the user and group ID of the files in container and to run as that user. This is added with a note that non-root configurations are untested. To build as non-root: `docker build --build-arg UID=1000 --build-arg GID=1000 --tag=open-webui:nonroot .` This is a no-op change in the default root configuration, which is why `$HOME` is still set to `/root`. We can't switch to nonroot by default, as this breaks existing users (and we have enough support requests around Docker usage as it is already, and we encourage users to setup Watchtower for automatic updates). We also don't build nonroot containers in CI because we're already running into total concurrency quotas on GitHub Actions. Adding a nonroot variant to the build matrix increases the number of tags from 3 to 6, and the total number of images from 6 to 12. Test docker build: https://github.com/cheahjs/open-webui-fork/actions/runs/9121520626 Addresses https://github.com/open-webui/open-webui/discussions/1698 and https://github.com/open-webui/open-webui/discussions/1021 Prior attempts: https://github.com/open-webui/open-webui/pull/1533 https://github.com/open-webui/open-webui/pull/2316 Tested locally with base, bundled ollama, and CUDA. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-11 17:35:05 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#7757