Hi team,
We are running self-hosted pipelines runners. Recently it is good to see that HTTP_PROXY and HTTPS_PROXY get exported to docker service in self-hosted pipelines runner, which gives us opportunity of simplifying pipelines.yml by not adding HTTP(S)_PROXY for the docker service in pipelines.yml.
In my bitbucket pipeline runner, we have HTTP(S)_PROXY, NO_PROXY, http(s)_proxy, no_proxy environments; and "httpProxy", "httpsProxy" and "noProxy" defined in ~/.docker/config.json; and "-Dhttps.proxyHost=<myproxy>< -Dhttps.proxyPort=<port> -Dhttp.proxyHost=<myproxy> -Dhttp.proxyPort=<port> -Dhttp.nonProxyHosts=<noproxyhosts>" in JAVA_TOOL_OPTIONS env variable. I guess docker service get HTTP(S)_PROXY from one of these settings.
Unfortunately NO_PROXY isn't exported for some reason, which causes issues for some registry (such as gcr.io) that should not go through proxy.
I was wondering if it's possible to also export NO_PROXY env variable to docker service.
The docker service used to be defined as
definitions:
services:
docker:
image:
- name: mydocker:dind
environment:
HTTP_PROXY: $HTTP_PROXY
HTTPS_PROXY: $HTTP_PROXY
NO_PROXY: $NO_PROXY
Now it can be defined as
definitions:
services:
docker:
image:
- name: mydocker:dind
environment:
NO_PROXY: $NO_PROXY
Once NO_PROXY is able to be exported to docker service, it can be defined as
definitions:
services:
docker:
image:
- name: mydocker:dind
I also wonder if we can define the default docker service image in an environment variable of bitbucket pipelines runner just as CLONE_IMAGE, AUTH_PROXY_IMAGE and PAUSE_IMAGE. Maybe more env variables for default resources that docker service consumes. If this is possible, we don't need to define docker service in the pipelines.yml at all. Our developers would be very happy that they don't have to care about these details so they can focus on their own work.
Kind regards,
Aaron