Add --host flag to docker model install-runner command #214
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.
Overview
This PR adds a
--hostflag to thedocker model install-runnercommand, allowing users to specify which host address to bind the Docker Model Runner to. This enables the model runner to be accessible from other machines, not just localhost.Problem
Previously, the Docker Model Runner was hardcoded to bind to
127.0.0.1, which meant it was only accessible from the local machine. Users who wanted to access the model runner from other machines on their network (e.g., for remote development, testing, or deployment scenarios) had no way to configure this.Solution
Added a
--hostflag that accepts any valid host address:Key Changes
--hostflag: Added to theinstall-runnercommand with a default value of127.0.0.1to maintain backward compatibilityCreateControllerContainerfunction: Modified to accept ahostparameter and use it for port binding instead of the hardcoded127.0.0.1127.0.0.1, maintaining the existing behavior for the default caseSecurity Considerations
The
ensureStandaloneRunnerAvailablefunction (used for automatic installation by other commands) intentionally continues to use127.0.0.1for security reasons. Users who want to expose the service to external networks must explicitly run theinstall-runnercommand with the--hostflag.Testing
--hostflagRelated
Fixes #<issue_number> (if applicable)
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.