Skip to content

Conversation

@Raymond0212
Copy link

@Raymond0212 Raymond0212 commented Oct 14, 2025

Summary

This merge request updates the container user ID (UID) from 1001 to 11001. The primary goal is to make the images fault-tolerant by default, ensuring they run safely even on host systems that are not specifically hardened for container security.

Problem & Rationale

On many Linux distributions, the first non-root user created on the system is assigned UID 1000 or 1001. When a container is run with a user that has the same UID as a host user, any files created in a mounted volume by the container user will appear to be owned by the host user, and vice versa.

This UID collision can lead to:

  • Permission Errors: The container might not be able to access files it needs if the host user's permissions are restrictive.
  • Security Risks: The container could potentially access or modify the host user's files unintentionally if volumes are mounted improperly.
  • Inconsistent Behaviour: The behaviour of the application can become unpredictable depending on the host system's user configuration.

Solution

To mitigate this, the UID for the container user has been changed to 11001. This is a higher, less commonly used UID, which significantly reduces the probability of a conflict with an existing user on the host machine. The change has been applied consistently across all Dockerfiles that define a user.

Impact

  • Improved Compatibility: This change makes the Docker images safer and more reliable to run across a wider variety of host systems without permission conflicts.
  • Enhanced Security: It hardens the container by isolating its user from the host's users.
  • No Breaking Changes: For the vast majority of users, this change will be transparent. It only affects users who might have built custom scripts or permissions systems that specifically depend on the previous UID of 1001.

This update is a best practice for containerisation and will improve the overall robustness of the project's Docker setup.

Thank you for your consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant