In RegistryAuthenticators, there is currently RegistryAuthenticator#forDockerHub.
Add RegistryAuthenticator#forOther that:
1) Fetches GET /v2/
2) Extracts the WWW-Authenticate header (eg. WWW-Authenticate: Bearer realm="https://gcr.io/v2/token",service="gcr.io")
3) Parses the header and authenticates accordingly.
In
RegistryAuthenticators
, there is currentlyRegistryAuthenticator#forDockerHub
.Add
RegistryAuthenticator#forOther
that:1) Fetches GET /v2/ 2) Extracts the WWW-Authenticate header (eg.
WWW-Authenticate: Bearer realm="https://gcr.io/v2/token",service="gcr.io"
) 3) Parses the header and authenticates accordingly.