docker

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2026 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package docker implements an MCPSource that provisions MCP servers in Docker containers. Uses the local `docker` CLI (no Docker SDK dep).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI interface {
	Run(ctx context.Context, spec RunSpec) (containerID string, err error)
	Stop(ctx context.Context, containerID string) error
	Exec(ctx context.Context, containerID string, argv []string) (stdout string, err error)
}

CLI is the minimal docker-CLI surface the source needs. Production code uses realCLI; tests supply a fake.

func NewCLI

func NewCLI() CLI

NewCLI returns a CLI backed by the local docker binary.

type Mount

type Mount struct {
	Source   string // host path
	Target   string // container path
	ReadOnly bool
}

Mount describes one -v flag on a container.

type RunSpec

type RunSpec struct {
	Image    string
	PortHost int
	PortCtr  int
	Env      map[string]string
	Mounts   []Mount
}

RunSpec is the arguments to `docker run`.

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source is the Docker-backed MCPSource.

func New

func New() *Source

New returns a Docker source using the local docker CLI.

func (*Source) Open

func (s *Source) Open(ctx context.Context, args map[string]any) (mcpsource.MCPConn, io.Closer, error)

Open validates args, starts the container, optionally clones a repo into /workspace, health-polls, and returns the MCP URL + closer.

Directories

Path Synopsis
Package register wires the Docker MCPSource into the global registry via a blank import.
Package register wires the Docker MCPSource into the global registry via a blank import.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL