Skip to content

Conversation

Copy link

Copilot AI commented Oct 10, 2025

Overview

This PR adds a --host flag to the docker model install-runner command, 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 --host flag that accepts any valid host address:

# Bind to all interfaces (accessible from any network interface)
docker model install-runner --host 0.0.0.0

# Bind to a specific IP address
docker model install-runner --host 192.168.1.100

# Default behavior remains unchanged (localhost only)
docker model install-runner

Key Changes

  1. New --host flag: Added to the install-runner command with a default value of 127.0.0.1 to maintain backward compatibility
  2. Updated CreateControllerContainer function: Modified to accept a host parameter and use it for port binding instead of the hardcoded 127.0.0.1
  3. Bridge gateway binding logic: Updated to only bind to the bridge gateway IP when using 127.0.0.1, maintaining the existing behavior for the default case
  4. Documentation: Updated the command reference to include the new flag
  5. Tests: Added comprehensive unit tests to verify the flag functionality

Security Considerations

The ensureStandaloneRunnerAvailable function (used for automatic installation by other commands) intentionally continues to use 127.0.0.1 for security reasons. Users who want to expose the service to external networks must explicitly run the install-runner command with the --host flag.

Testing

  • ✅ All existing tests pass
  • ✅ New unit tests added for the --host flag
  • ✅ Verified build succeeds
  • ✅ Backward compatibility maintained

Related

Fixes #<issue_number> (if applicable)

Original prompt

We want to add an option so we can start docker model runner on hosts other than 127.0.0.1:

docker model install-runner --host 0.0.0.0


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Add option to start docker model runner on other hosts Add --host flag to docker model install-runner command Oct 10, 2025
Copilot AI requested a review from ericcurtin October 10, 2025 18:37
@ericcurtin ericcurtin closed this Oct 10, 2025
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