astral-sh / astral-sh/uv-docker-example

Use non-conflicting UID/GID for nonroot (e.g. 9999) — GID 999 is often taken by systemd-journal

Open
#84 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dockerfile
Stars
809
Forks
84
PR merge metrics
No merged PRs in 30d

Description

### Summary

Examples that create an app user with **UID/GID 999** can fail once the image installs packages that pull in **systemd**, because Debian/Ubuntu postinst scripts commonly create the **`systemd-journal`** group with **GID 999**. After that, `groupadd --gid 999 …` exits with **code 4** (“GID already exists”).

### Suggestion

In Docker examples that hard-code a non-root user, prefer a **high, uncommon** UID/GID pair (e.g. **9999**) or omit fixed IDs and let `useradd`/`groupadd` allocate, and document why 999 is risky in “full” images.

### Motivation

`systemd-journal` on GID 999 is **very common** on Debian-derived images once systemd is present, so **999** is a poor default for custom application users in recipes that may combine `uv`/Python slim with desktop/browser or other systemd-using stacks.

---

Assisted by Cursor

Contributor guide

No contributing guide indexed for this repository

Research direction

Inspect the Docker examples that create a non-root user with UID/GID 999, then check how package installation can reserve GID 999 for systemd-journal. Done means the affected examples use a non-conflicting or allocated ID and explain why 999 is risky.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.