fix(images): use UID 1000 for agent user instead of 1001#25
Closed
fix(images): use UID 1000 for agent user instead of 1001#25
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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 1000Rationale
The choice of 1001 in jonwiggins#466 was made to match the K8s securityContext that was already set to 1001. However, using 1000:
This PR takes the opposite approach: change the K8s securityContext to match UID 1000 rather than changing the Dockerfile to match 1001.
Test plan