client: Allow Proxy Configuration in config.json #32966
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a redux of #30588 rebased and after the repo move!
- What I did
Added a mechanism to allow HTTP/HTTPS/FTP/NO proxy variables to be configured in
config.json. These are then automatically populated in adocker runcommand as environment variables or asbuild-argsindocker build!This makes it easier for users suffering behind an HTTP Proxy as they only need to configure this once as opposed to creating custom aliases or forgetting the args and being denied buildage/runnage.
Updates #30323
- How I did it
Extended the
configfilewith some new proxy related variables.These are scoped per Docker Host with a
defaultcatchall.The config file is then read by the
buildorruncommand and the necessary variables are exported.A
-eflag or--build-argprovided on the CLI will override these default settings.- How to verify it
There are integration tests! But manually, you may:
config.jsonwith{ "proxies" : { "httpProxy" : "http://127.0.0.1:3001" }docker --config /path/to/config build -t configtest .HTTP_PROXYvariable is as configureddocker run --rm configtest env- Description for the changelog
Added HTTP/HTTPS/FTP proxy configuration to
config.json- A picture of a cute animal (not mandatory but encouraged)