Skip to content

change Docker image to run as nonroot for k8s clusters restricting to runAsNonRoot#515

Merged
xrmx merged 2 commits intomainfrom
trentm-docker-nonroot
Apr 1, 2026
Merged

change Docker image to run as nonroot for k8s clusters restricting to runAsNonRoot#515
xrmx merged 2 commits intomainfrom
trentm-docker-nonroot

Conversation

@trentm
Copy link
Copy Markdown
Member

@trentm trentm commented Mar 31, 2026

@trentm trentm requested a review from a team as a code owner March 31, 2026 16:27
Comment thread operator/Dockerfile
Comment thread operator/Dockerfile.alpine
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 31, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6f4970bd-9dc4-4559-bfc7-55b92f1dbd73

📥 Commits

Reviewing files that changed from the base of the PR and between ba63e71 and fccb53c.

📒 Files selected for processing (1)
  • operator/Dockerfile.alpine
🚧 Files skipped from review as they are similar to previous changes (1)
  • operator/Dockerfile.alpine

📝 Walkthrough

Walkthrough

Both Dockerfiles were changed to set file ownership during copy and to run subsequent stages as non-root users. operator/Dockerfile now uses COPY --chown=65532:65532 for workspace artifacts and adds USER 65532:65532. operator/Dockerfile.alpine uses COPY --chown=65534:65534 and adds USER 65534:65534 before a RUN chmod -R go+r /autoinstrumentation.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch trentm-docker-nonroot
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@operator/Dockerfile.alpine`:
- Around line 18-23: The COPY step copies /operator-build/workspace to
/autoinstrumentation as root, then USER 65534:65534 is set and RUN chmod -R go+r
/autoinstrumentation will fail; fix by either adding --chown=65534:65534 to the
COPY --from=build /operator-build/workspace /autoinstrumentation command so
files are owned by UID:GID 65534, or move the RUN chmod -R go+r
/autoinstrumentation before the USER 65534:65534 line (ensuring the chmod runs
as root).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 41470151-8417-47cf-ad36-8ac447605581

📥 Commits

Reviewing files that changed from the base of the PR and between 5c0b40f and ba63e71.

📒 Files selected for processing (2)
  • operator/Dockerfile
  • operator/Dockerfile.alpine

Comment thread operator/Dockerfile.alpine Outdated
Copy link
Copy Markdown
Member

@xrmx xrmx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@xrmx xrmx merged commit fd8f853 into main Apr 1, 2026
19 checks passed
@trentm trentm deleted the trentm-docker-nonroot branch April 1, 2026 17:24
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.

2 participants