Skip to content

docs: ContainerCodeExecutor runs as the image's user, not non-root - #7714

Closed
EmanueleCell4 wants to merge 1 commit into
google:mainfrom
EmanueleCell4:docs/container-executor-user
Closed

EmanueleCell4 wants to merge 1 commit into
google:mainfrom
EmanueleCell4:docs/container-executor-user

Conversation

@EmanueleCell4

Copy link
Copy Markdown
Contributor

Fixes #7712

The code executor guide said ContainerCodeExecutor starts the container as a non-root user. Neither containers.run nor exec_run in container_code_executor.py sets a user, so code runs as the image's configured user, which is root for python:3.11-slim (the image used in the guide's own example).

This PR only corrects the guide: it keeps the accurate parts (network off, all capabilities dropped, no-new-privileges) and tells readers to use an image with a non-root USER if they need one. Runtime user selection is left out of scope, as discussed in the issue, since forcing a UID could break custom images.

@google-cla

google-cla Bot commented Oct 24, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

The guide said the container starts as a non-root user, but neither
containers.run nor exec_run sets a user, so code runs as the image's
configured user (root for python:3.11-slim).

Fixes google#7712

Co-authored-by: samecho <zhayutong@gmail.com>
@EmanueleCell4
EmanueleCell4 force-pushed the docs/container-executor-user branch from 5dc64f8 to f32580f Compare October 26, 2026 11:19
copybara-service Bot pushed a commit that referenced this pull request Oct 27, 2026
@adk-bot

adk-bot commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

Thank you @EmanueleCell4 for your contribution! 🎉

Your changes have been successfully imported and merged via Copybara in commit 7a64c7c.

Closing this PR as the changes are now in the main branch.

@adk-bot adk-bot added the merged [Status] This PR is merged label Oct 27, 2026
@adk-bot adk-bot closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged [Status] This PR is merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ContainerCodeExecutor docs say non-root, but the container runs as the image's default user (root for python:3.11-slim)

3 participants