Claus-Theodor Riegg
7 years
Claus-Theodor Riegg
7 years
Stefan Langenmaier
1 year
Andreas Vöst
4 months
Claus-Theodor Riegg
5 years
Andreas Vöst
5 months
Emma Heinle
6 months
Andreas Vöst
6 months
Kim Klotz
7 months

HowTo: Add custom headers to docker client requests

Posted . Visible to the public.

It is possible to add custom http header Show archive.org snapshot to request made by the docker CLI client. This can be used to e.g. add another authentication header for a proxy.

Implementation

config.json

Add an entry to ~/.docker/config.json:

{
	"HttpHeaders": {
		"X-Meta-$YOURKEY": "SomeValue"
	}
}

Environment Variable (Experimental)

Warning

Requires version v27.1 or higher.

Set DOCKER_CUSTOM_HEADERS, must be provided as a comma-seperated list of name=value pairs Show archive.org snapshot .

Caveats:

Ruben Aleman
Last edit
Ruben Aleman
Keywords
container
License
Source code in this card is licensed under the MIT License.