Service Proxies
Dagger can be configured to use HTTP(S) proxies to connect to external HTTP services. This configuration applies to "core" operations like pulling container images, cloning Git repositories, etc. and is also supplied to user containers in the form of standard environment variables.
The engine supports the following standard environment variables:
HTTP_PROXYHTTPS_PROXYNO_PROXYALL_PROXYFTP_PROXY
As well as the custom environment variable:
_DAGGER_ENGINE_SYSTEMENV_GOPROXY— set this on the engine container. Dagger propagates it into Go module downloads (including SDK codegen) asGOPROXY. Use this when the default Go module proxy (https://proxy.golang.org) is unreachable and you need a mirror such ashttps://goproxy.cn,direct.
Configuring these settings requires provisioning a custom
engine. Set the variable(s) on that engine container,
then point the CLI at it with _EXPERIMENTAL_DAGGER_RUNNER_HOST — see
Custom Runner for how to start the
engine with those environment variables.
As mentioned above, these proxy environment variables set on Dagger will also
be automatically set on all containers created by userspace Dagger Functions
(i.e. containers created via a withExec API call) unless otherwise specified.
This is useful so that Dagger code you are not in direct control of (e.g. an external module dependency) does not need to be forked and updated to use your proxies in order to operate in your network where those proxy settings may be strictly required.
The values of these environment variables do not impact the caching of those containers and are not persisted in Dagger's cache. Changing the value of the settings won't invalidate the cache of the container's execution.
Additionally, if the withEnvVariable API is used to explicitly set any of
those proxy environment variable values, those will override any settings
inherited from Dagger's proxy configuration.