I’ve been able to set a default docker proxy config for my containers following the official docs here by adding this to my ~/.docker/config.json
{
"proxies": {
"default": {
"httpProxy": "http://192.168.1.12:3128",
"httpsProxy": "http://192.168.1.12:3128",
"noProxy": "*.test.example.com,.example2.com,127.0.0.0/8"
}
}
}
However, I’d like to apply this proxy config to only certain containers, not all containers. My question is around the "default"
keyword in this config… it suggests to me it might be possible to have a non-default config, then apply that to a certain container, maybe like this?
{
"proxies": {
- "default": {
+ "MySpecialProxyConfig": {
"httpProxy": "http://192.168.1.12:3128",
"httpsProxy": "http://192.168.1.12:3128",
"noProxy": "*.test.example.com,.example2.com,127.0.0.0/8"
}
}
}
And then apply this to a container somehow? e.g. docker run --env proxy_config=MySpecialProxyConfig etc...
I’m wondering if anyone knows if there’s any way to do this, or something like this? Or does Docker only support a default proxy?