You can use registry extensions to provide your pipelines with docker login credentials. If your pipeline depends on private images, these credentials are used to authenticate with a remote registry and pull private images.
Configuration
You can register an extension with your runners by providing the following configuration parameters:
-
DRONE_REGISTRY_PLUGIN_ENDPOINT
- Provides the endpoint used to make http requests to a registry extension.
-
DRONE_REGISTRY_PLUGIN_TOKEN
- Provides the token used to authenticate http requests to the extension. This token is shared between the server and extension.
How it Works
The runner makes an HTTP POST request to retrieve a list of registry credentials. The runner matches the registry credentials with docker images in your yaml by comparing the registry address with the fully-qualified image url.
Request
The registry extension receives an HTTP request to return a list of registry credentials. The JSON-encoded request body includes the repository and build information.
Request Body definition:
|
|
|
|
|
|
Response
The registry extension should respond to the request with a 200 response code and a list of registry credentials in JSON format.
Registry definition:
|
|
Example response:
[
{
"address": "docker.io",
"username": "octocat",
"password": "correct-horse-battery-staple"
}
]
Authorization
The http request is signed per the http signatures draft specification use the shared secret. The receiver should use the signature to verify the authenticity and integrity of the webhook.
Starter Project
If you are interested in creating a registry extension we recommend using our starter project as a base to jumpstart development.