Add proxy support for model pulling behind firewall#46
Draft
Conversation
- Pass proxy environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) to docker-model-runner container - Configure HTTP transport to use ProxyFromEnvironment for model pulling - Add tests for proxy configuration in both container creation and transport Co-authored-by: ericcurtin <1694275+ericcurtin@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix model pulling issue behind firewall
Add proxy support for model pulling behind firewall
Oct 19, 2025
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.
Problem
When running Docker Engine behind a firewall with proxy configuration (e.g., in
/etc/systemd/system/docker.service.d/http-proxy.conf), Docker image pulls work correctly, but model pulls fail with "TLS handshake timeout" errors:This occurs because proxy environment variables are not being passed to the
docker-model-runnercontainer, preventing it from communicating with the registry through the proxy.Solution
This PR implements automatic proxy configuration inheritance for the model-runner container and HTTP transport:
1. Container Proxy Environment Variables
Modified
CreateControllerContainerincmd/cli/pkg/standalone/containers.goto automatically detect and pass proxy environment variables from the host to the container:2. Proxy-Aware HTTP Transport
Updated
main.goto configure the HTTP transport to explicitly usehttp.ProxyFromEnvironment:Usage
No action required from users. The fix works automatically when proxy environment variables are set:
Testing
Added comprehensive test coverage:
TestProxyEnvironmentVariablesPassedToContainer: Verifies proxy variables are correctly passed to containersTestProxyTransportConfiguration: Verifies HTTP transport is proxy-awareSecurity
Benefits
Fixes the issue where model pulls fail behind firewalls while image pulls succeed.
Original prompt
Fixes docker#139
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.