Resolves Docker registry credentials from the user's Docker config file
(typically ~/.docker/config.json) and returns a ready-to-send
X-Registry-Auth header value.
Scope:
- Only the
authsmap inconfig.jsonis supported. - Credential helpers (
credsStore,credHelpers) are intentionally out of scope — if encountered, a debug log is emitted andnilis returned so the caller can fall back to anonymous access.
The DOCKER_CONFIG environment variable is honoured: when set, the config
file is read from $DOCKER_CONFIG/config.json; otherwise the default path
~/.docker/config.json is used.
The header value is a URL-safe base64 encoding (without padding) of a JSON document describing the credentials, as specified by the Docker Engine API.
Summary
Functions
Returns the registry key that should be used for looking up credentials
for the given image (Docker config convention).
Resolves registry credentials for the given image and returns the
ready-to-send X-Registry-Auth header value, or nil if no matching
credentials can be found.
Functions
Returns the registry key that should be used for looking up credentials
for the given image (Docker config convention).
Unnamespaced or explicitly docker.io-hosted images resolve to
https://index.docker.io/v1/; everything else resolves to the registry
host component of the image reference.
Resolves registry credentials for the given image and returns the
ready-to-send X-Registry-Auth header value, or nil if no matching
credentials can be found.
config_path may be nil, in which case the default lookup logic is used
(respecting the DOCKER_CONFIG environment variable).