plugin_push
Push an installed Docker plugin to its registry, using stored credentials and returning progress with error handling.
Instructions
Push an installed plugin to its registry.
The write-side counterpart to plugin_install (which pulls) and the publish step after
plugin_create builds a plugin locally: name must already be the registry-qualified name the
plugin is installed under, since — unlike image_push — there is no plugin equivalent of
image_tag to rename it first, so create it under the target name. The plugin does not need to
be enabled. Credentials come from system_login, or from ~/.docker/config.json if the host
ran docker login. Does NOT raise when the registry rejects the push: an authentication or
quota failure arrives as a final progress record and is surfaced as the error key, so check
that key rather than assuming success. Raises RuntimeError if the installed docker-py is too
old to expose the internals below, and docker.errors.APIError if the plugin isn't installed.
Bypasses docker-py's Plugin.push()/APIClient.push_plugin(), which cannot work: both POST to
/plugins/{name}/pull, a route the Engine does not define (push is /plugins/{name}/push), so
they 404 against any daemon. Bug present since the method was written in 2017 and still in
docker-py main; it survives because upstream has no test covering it. This calls the correct
endpoint through docker-py's private request helpers, in the manner of system_logout's
api._auth_configs reach-in, and fails loudly if those internals change shape.
Caveat for ssh:// daemons: docker-py can't cancel an SSH stream, so the timeout_seconds
watchdog can't interrupt a push that stalls with the connection still open — the same limitation
container_logs carries in follow mode. The call still returns normally once the registry
answers or the stream ends.
args:
name - Installed plugin name to push, [registry/]author/name:tag; :latest if the tag is
omitted. A bare author/name pushes to Docker Hub
timeout_seconds - Max wall-clock seconds to wait on the push stream before returning what
was collected (default 300); raise it for a large plugin over a slow link
returns: dict - {"name", "progress": [], "truncated": bool, "error": str
or None} — error is non-None only when the registry reported a failure
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| timeout_seconds | No |