Documentation
¶
Overview ¶
Package templates provides utilities for generating Dockerfile templates based on different transport types (uvx, npx).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDockerfileTemplate ¶
func GetDockerfileTemplate(transportType TransportType, data TemplateData) (string, error)
GetDockerfileTemplate returns the Dockerfile template for the specified transport type.
Types ¶
type TemplateData ¶
type TemplateData struct {
// MCPPackage is the name of the MCP package to run.
MCPPackage string
// MCPPackageClean is the package name with version suffix removed.
// For example: "@org/package@1.2.3" becomes "@org/package", "package@1.0.0" becomes "package"
// This field is automatically populated by GetDockerfileTemplate.
MCPPackageClean string
// CACertContent is the content of the custom CA certificate to include in the image.
CACertContent string
// IsLocalPath indicates if the MCPPackage is a local path that should be copied into the container.
IsLocalPath bool
// BuildArgs are the arguments to bake into the container's ENTRYPOINT at build time.
// These are typically required subcommands (e.g., "start") that must always be present.
// Runtime arguments passed via "-- <args>" will be appended after these build args.
BuildArgs []string
// BuildEnv contains environment variables to inject into the Dockerfile builder stage.
// These are used for configuring package managers (e.g., custom registry URLs).
// Keys must be uppercase with underscores, values are validated for safety.
BuildEnv map[string]string
}
TemplateData represents the data to be passed to the Dockerfile template.
type TransportType ¶
type TransportType string
TransportType represents the type of transport to use.
const ( // TransportTypeUVX represents the uvx transport. TransportTypeUVX TransportType = "uvx" // TransportTypeNPX represents the npx transport. TransportTypeNPX TransportType = "npx" // TransportTypeGO represents the go transport. TransportTypeGO TransportType = "go" )
func ParseTransportType ¶
func ParseTransportType(s string) (TransportType, error)
ParseTransportType parses a string into a transport type.
Click to show internal directories.
Click to hide internal directories.