Skip to content

fix(images): use UID 1000 for agent user instead of 1001#25

Closed
genisd wants to merge 1 commit intomainfrom
fix/use-uid-1000-for-agent-user
Closed

fix(images): use UID 1000 for agent user instead of 1001#25
genisd wants to merge 1 commit intomainfrom
fix/use-uid-1000-for-agent-user

Conversation

@genisd
Copy link
Copy Markdown
Member

@genisd genisd commented Apr 21, 2026

Summary

  • Use UID/GID 1000 instead of 1001 for the agent user in containers
  • UID 1000 is the conventional first non-system user on Linux
  • Avoids conflicts with pre-existing UIDs when using hostPath volumes or bind mounts

Changes

  • images/base.Dockerfile: create agent user with UID/GID 1000, remove ubuntu user first (Ubuntu 24.04 ships with ubuntu at UID 1000)
  • apps/api/src/services/k8s-workload-service.ts: update securityContext and init container to use 1000

Rationale

The choice of 1001 in jonwiggins#466 was made to match the K8s securityContext that was already set to 1001. However, using 1000:

  • Is the standard convention for the first non-root user
  • Works better with developer tooling that assumes UID 1000
  • Simplifies debugging when exec-ing into pods

This PR takes the opposite approach: change the K8s securityContext to match UID 1000 rather than changing the Dockerfile to match 1001.

Test plan

  • Typecheck passes
  • All tests pass
  • Deploy to test cluster and verify agent pods start correctly
  • Verify git operations work (clone, commit, push)

UID 1000 is the conventional first non-system user on Linux and avoids
conflicts with pre-existing UIDs on the host when using hostPath volumes
or bind mounts. The previous choice of 1001 required removing the
ubuntu user (UID 1000) which is fragile across base image versions.

Changes:
- Dockerfile: create agent user with UID/GID 1000, remove ubuntu user first
- k8s-workload-service: update securityContext and init container to 1000

This reverts the UID portion of commit 8a7db32 while keeping the
alignment between Dockerfile and K8s securityContext.
@genisd genisd closed this Apr 21, 2026
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