Skip to content

Conversation

Copy link

Copilot AI commented Nov 10, 2025

docker model pull and docker model run fail when Docker daemon has proxy settings configured (visible in docker info). The model runner container only reads proxy environment variables from the shell, ignoring daemon configuration.

Changes

Modified cmd/cli/pkg/standalone/containers.go:

  • Added getProxySettings() to retrieve proxy settings from Docker daemon via dockerClient.Info(ctx), falling back to environment variables
  • Added mergeDockerProxySettings() to merge daemon proxy settings (HTTPProxy, HTTPSProxy, NoProxy fields) with environment variables
  • Daemon settings override environment variables when both are present
  • Both uppercase and lowercase variants are set for compatibility

Added cmd/cli/pkg/standalone/containers_test.go:

  • Unit tests covering daemon settings, environment variables, precedence rules, and partial configurations

Example

When Docker daemon is configured with proxies:

$ docker info | grep Proxy
 HTTP Proxy: http://proxy.example.com:8080
 HTTPS Proxy: https://proxy.example.com:8443

The model runner container now receives these settings automatically, without requiring shell environment variables.

Original prompt

This section details on the original issue you should resolve

<issue_title>docker model pull/run does not respect configured proxy settings</issue_title>
<issue_description>I have configured a proxy for Docker, and docker pull works correctly. I can pull Docker images without any issues.

❯ docker pull ubuntu:22.04
22.04: Pulling from library/ubuntu
af6eca94c810: Pull complete 
Digest: sha256:09506232a8004baa32c47d68f1e5c307d648fdd59f5e7eaa42aaf87914100db3
Status: Downloaded newer image for ubuntu:22.04
docker.io/library/ubuntu:22.04 

docker info:

❯ docker info
Client: Docker Engine - Community
 Version:    28.5.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.1
    Path:     /home/xiaodongye/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.29.6
    Path:     /home/xiaodongye/.docker/cli-plugins/docker-compose
  model: Docker Model Runner (Docker Inc.)
    Version:  v0.1.44
    Path:     /usr/libexec/docker/cli-plugins/docker-model

Server:
 Containers: 1
  Running: 1
  Paused: 0
  Stopped: 0
 Images: 3
 Server Version: 28.5.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: b98a3aace656320842a23f4a392a33f46af97866
 runc version: v1.3.0-0-g4ca628d1
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 5.15.0-105-generic
 Operating System: Ubuntu 22.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.09GiB
 Name: xiaodongye-s80
 ID: a01ea8ac-26f1-413f-923c-bc112f76dc8d
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http://192.168.10.69:6152/
 HTTPS Proxy: http://192.168.10.69:6152/
 No Proxy: localhost,127.0.0.0/8
 Username: mthreads
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false

However, when using docker model pull or docker model run, the commands fail to use the configured proxy and encounter the following issue:

❯ docker model pull ai/smollm2
Failed to pull model: unexpected end of stream while pulling model ai/smollm2
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix docker model pull/run to respect proxy settings Fix docker model pull/run to respect Docker daemon proxy settings Nov 10, 2025
Copilot AI requested a review from ericcurtin November 10, 2025 10:14
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.

docker model pull/run does not respect configured proxy settings

2 participants