CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-docker

A Python library for the Docker Engine API.

Pending
Overview
Eval results
Files

plugin-management.mddocs/

Plugin Management

Docker plugin installation, configuration, and lifecycle management with support for volume drivers, network drivers, and custom plugin development.

Capabilities

PluginCollection

class PluginCollection:
    def create(self, **kwargs):
        """
        Create a plugin from a rootfs and config.
        
        Args:
            **kwargs: Plugin creation options
            
        Returns:
            Plugin: Created plugin instance
            
        Common kwargs:
            name (str): Plugin name
            plugin_data_dir (str): Path to plugin data
        """

    def get(self, name):
        """
        Get a plugin by name.
        
        Args:
            name (str): Plugin name
            
        Returns:
            Plugin: Plugin instance
        """

    def list(self, filters=None):
        """
        List plugins.
        
        Args:
            filters (dict): Filter results by capability, enable status
            
        Returns:
            list[Plugin]: List of plugin instances
        """

    def install(self, remote_name, local_name=None):
        """
        Install a plugin from Docker Hub or registry.
        
        Args:
            remote_name (str): Remote plugin name
            local_name (str): Local name for plugin
            
        Returns:
            Plugin: Installed plugin instance
        """

Plugin Model

class Plugin:
    """
    A Docker plugin instance.
    
    Properties:
        id (str): Plugin ID
        name (str): Plugin name
        enabled (bool): Plugin enabled status
        attrs (dict): Raw plugin attributes
    """

    def configure(self, options):
        """
        Configure plugin options.
        
        Args:
            options (dict): Plugin configuration options
        """

    def disable(self, **kwargs):
        """
        Disable the plugin.
        
        Args:
            **kwargs: Disable options (force)
        """

    def enable(self, timeout=0):
        """
        Enable the plugin.
        
        Args:
            timeout (int): Timeout for enable operation
        """

    def push(self, **kwargs):
        """Push plugin to registry."""

    def remove(self, **kwargs):
        """
        Remove the plugin.
        
        Args:
            **kwargs: Remove options (force, v)
        """

    def upgrade(self, **kwargs):
        """
        Upgrade the plugin.
        
        Args:
            **kwargs: Upgrade options
        """

Usage Examples

import docker

client = docker.from_env()

# Install volume plugin
plugin = client.plugins.install('vieux/sshfs')

# Configure plugin
plugin.configure({'sshkey.source': '/home/user/.ssh/id_rsa'})

# Enable plugin
plugin.enable()

# Use plugin with volume
volume = client.volumes.create(
    name='ssh-volume',
    driver='vieux/sshfs:latest',
    driver_opts={
        'sshcmd': 'user@server:/path',
        'allow_other': ''
    }
)

Install with Tessl CLI

npx tessl i tessl/pypi-docker

docs

client-management.md

config-secrets.md

container-management.md

context-management.md

error-handling.md

image-management.md

index.md

network-management.md

plugin-management.md

swarm-services.md

system-events.md

volume-management.md

tile.json