feat: Add container exec functionality with comprehensive API#86
Closed
Talador12 wants to merge 1 commit intocloudflare:mainfrom
Closed
feat: Add container exec functionality with comprehensive API#86Talador12 wants to merge 1 commit intocloudflare:mainfrom
Talador12 wants to merge 1 commit intocloudflare:mainfrom
Conversation
Talador12
commented
Sep 7, 2025
- Adds exec() method to Container class for executing commands in running containers
- Automatic container startup and health checking - no manual state management required
- Support for string commands, command arrays, and rich execution options
- Configurable working directory, environment variables, and timeout
- Comprehensive error handling with proper exit codes and timeout support
- Returns detailed ExecResult with stdout, stderr, exit code, success flag, and duration
- Uses HTTP communication to container's /__exec endpoint for command execution
- Comprehensive test coverage for all execution scenarios and error cases
- Adds exec() method to Container class for executing commands in running containers - Automatic container startup and health checking - no manual state management required - Support for string commands, command arrays, and rich execution options - Configurable working directory, environment variables, and timeout - Comprehensive error handling with proper exit codes and timeout support - Returns detailed ExecResult with stdout, stderr, exit code, success flag, and duration - Uses HTTP communication to container's /__exec endpoint for command execution - Comprehensive test coverage for all execution scenarios and error cases
gpanders
reviewed
Sep 8, 2025
| AbortSignal.any ? AbortSignal.any(signals) : controller.signal; | ||
|
|
||
| // Make HTTP request to container's exec endpoint | ||
| const response = await tcpPort.fetch('http://container/__exec', { |
Member
There was a problem hiding this comment.
Where does this __exec endpoint come from?
Author
There was a problem hiding this comment.
I'll need to rewrite this section to use the SSH integration
6 tasks
Author
|
Blocked on cloudflare/workers-sdk#10582 Will update this PR when that one is merged |
Author
|
Tied to |
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.