Add Docker network commands and update execution logic for container networking.#21
Merged
gustavofreze merged 1 commit intomainfrom Apr 14, 2026
Merged
Add Docker network commands and update execution logic for container networking.#21gustavofreze merged 1 commit intomainfrom
gustavofreze merged 1 commit intomainfrom
Conversation
…ainer networking.
There was a problem hiding this comment.
Pull request overview
This PR extends the container runtime flow to support Docker network host connectivity by introducing a docker network connect command and wiring it into the container start sequence when running inside Docker.
Changes:
- Added a
HostEnvironmentutility to detect Docker execution and fetch the current container hostname. - Introduced
DockerNetworkConnectand updatedContainerCommandHandler::run()to connect the “host” (test-runner) container to the target network when inside Docker. - Updated unit tests and mocks to account for the additional network-connect command and added a regression test for the “outside Docker” path.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Unit/MySQLDockerContainerTest.php | Adjusts expected command ordering after inserting network connect; removes a redundant factory-instance assertion. |
| tests/Unit/Mocks/ClientMock.php | Adds support for executing the new network commands in the mock client. |
| tests/Unit/GenericDockerContainerTest.php | Updates command index expectations and adds a separate-process test to force “outside Docker” behavior. |
| src/Internal/Containers/HostEnvironment.php | Adds Docker environment detection and hostname retrieval. |
| src/Internal/Commands/DockerNetworkConnect.php | Adds a command builder for docker network connect. |
| src/Internal/CommandHandler/ContainerCommandHandler.php | Executes network creation and (when inside Docker) connects the host container to the network before docker run. |
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.
No description provided.