-
Notifications
You must be signed in to change notification settings - Fork 517
Contribute a Registry Provider
Brandon Waterloo [MSFT] edited this page Mar 17, 2020
·
6 revisions
First, try connecting your registry as a "Generic Docker Registry". Many registries will work with our existing implementation of the Docker V2 API and do not require any additional contributions.
This feature has the following limitations:
- It currently only supports basic authentication, or token endpoints that accept basic authentication.
- You must connect a private registry. It won't work for central registries like Docker Hub or GitLab that host repositories for many users under unique namespaces.
If the "Generic Docker Registry" support is not sufficient, follow these steps to contribute a new provider:
- Determine registry API: Most registries support the Docker Registry V2 API. In general, any registry provider contribution using a custom API will be scrutinized more closely; it is strongly preferred that all registries support the V2 API.
- Determine registry authentication: Most registry providers have their own authentication mechanism. For example, some require credential helpers, some require OAuth client application registration, etc.
- Get Started: Follow the steps in the contributing section to clone and start working in our repo.
-
Implement: Add at least the following code:
- For Registry V2 clients:
- Add a provider registration in
src/tree/registries/dockerV2
, similar tosrc/tree/registries/dockerV2/genericDockerV2RegistryProvider.ts
, and add it to the list insrc/tree/registries/all/getRegistryProviders.ts
. - If needed, add an authentication provider implementing
IAuthProvider
insrc/tree/registries/auth
.
- Add a provider registration in
- For non-Registry V2 clients:
- Add an entry for your api in
src/tree/registries/all/RegistryApi.ts
- Add a new folder in
src/tree/registries
for your provider - Create an
IRegistryProvider
in your new folder, implementing all required fields, and add it to the list insrc/tree/registries/all/getRegistryProviders.ts
- Add an entry for your api in
- For Registry V2 clients:
- Submit a PR!
If you feel that framework changes are needed in order to support your registry provider contribution, please let us know.
Maintaining good quality documentation is a priority for the Docker extension team. If you find missing or inaccurate content, or if you'd like to extend the wiki with a topic or tutorial, please let us know by opening an issue.