-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Milestone
Description
I have a ~/.docker/config.json
with some a proxy configuration:
{
"auths": {
"my-registry.net": {
"auth": "XXXXXXXXXXX"
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/18.09.0-ce (linux)"
},
"proxies": {
"default": {
"httpProxy": "http://my-proxy.com:8000",
"noProxy": "localhost,localaddress,.localdomain.com,/var/run/docker.sock"
}
}
}
This config is taken into account when I use the CLI client:
~ $ docker run -it busybox /bin/sh -c 'env | grep -i proxy'
HTTP_PROXY=http://my-proxy.com:8000
http_proxy=http://my-proxy.com:8000
no_proxy=localhost,localaddress,.localdomain.com,/var/run/docker.sock
NO_PROXY=localhost,localaddress,.localdomain.com,/var/run/docker.sock
But with the python client:
In [1]: import docker
In [2]: client = docker.from_env()
In [3]: client.containers.run('busybox', '/bin/sh -c "env|grep -i proxy || true"', tty=True, stdin_open=True)
Out[3]: b''
Metadata
Metadata
Assignees
Labels
No labels