builder

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ImageTitleLabel       = "org.opencontainers.image.title"
	ImageDescriptionLabel = "org.opencontainers.image.description"
	ImageCreatedLabel     = "org.opencontainers.image.created"
	ImageRefNameLabel     = "org.opencontainers.image.ref.name"
	ImageVersionLabel     = "org.opencontainers.image.version"
	McpServerNameLabel    = "io.modelcontextprotocol.server.name"
)

various standard oci labels

View Source
const DefaultBaseImage = "registry.access.redhat.com/ubi9/ubi-minimal:latest"

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryProvider

type BinaryProvider interface {
	ExtractServerBinary(platform *v1.Platform) ([]byte, fs.FileInfo, error)
}

BinaryProvider interface for accessing server binaries

type BuildOptions

type BuildOptions struct {
	Platform               *v1.Platform // Target platform (linux/amd64, etc.)
	BaseImage              string       // Base image reference
	MCPToolDefinitionsPath string       // path to the MCP file
	MCPServerConfigPath    string       // path to the MCP server configuration file
	ImageTag               string       // output image tag
}

func (*BuildOptions) SetDefaults

func (o *BuildOptions) SetDefaults()

type DaemonImageSaver

type DaemonImageSaver struct{}

DaemonImageSaver implements ImageSaver for saving to local container engine

func (*DaemonImageSaver) SaveImage

func (d *DaemonImageSaver) SaveImage(ctx context.Context, img v1.Image, ref string) error

func (*DaemonImageSaver) SaveImageIndex added in v0.1.1

func (d *DaemonImageSaver) SaveImageIndex(ctx context.Context, idx v1.ImageIndex, ref string) error

type DefaultImageDownloader

type DefaultImageDownloader struct{}

DefaultImageDownloader implements ImageDownloader using go-containerregistry

func (*DefaultImageDownloader) DownloadImage

func (d *DefaultImageDownloader) DownloadImage(ctx context.Context, baseImage string, platform *v1.Platform) (v1.Image, error)

type DownloadBinaryProvider added in v0.2.0

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

DownloadBinaryProvider implements BinaryProvider by downloading from GitHub releases

func NewDownloadBinaryProvider added in v0.2.0

func NewDownloadBinaryProvider(version string, verbose bool) (*DownloadBinaryProvider, error)

NewDownloadBinaryProvider creates a new provider that downloads binaries

func (*DownloadBinaryProvider) ExtractServerBinary added in v0.2.0

func (dp *DownloadBinaryProvider) ExtractServerBinary(platform *v1.Platform) ([]byte, fs.FileInfo, error)

ExtractServerBinary downloads and returns the server binary for the specified platform

type FileSystem

type FileSystem interface {
	Stat(name string) (fs.FileInfo, error)
	ReadFile(name string) ([]byte, error)
}

FileSystem interface for file operations

type ImageBuilder

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

func New

func New(saveToRegistry bool, version string, verbose bool) (*ImageBuilder, error)

New creates a new ImageBuilder that downloads binaries from GitHub releases

func (*ImageBuilder) Build

func (b *ImageBuilder) Build(ctx context.Context, opts BuildOptions) (v1.Image, error)

func (*ImageBuilder) BuildMultiArch added in v0.1.1

func (b *ImageBuilder) BuildMultiArch(ctx context.Context, opts MultiArchBuildOptions) (v1.ImageIndex, error)

func (*ImageBuilder) Save

func (b *ImageBuilder) Save(ctx context.Context, img v1.Image, ref string) error

func (*ImageBuilder) SaveIndex added in v0.1.1

func (b *ImageBuilder) SaveIndex(ctx context.Context, idx v1.ImageIndex, ref string) error

type ImageDownloader

type ImageDownloader interface {
	DownloadImage(ctx context.Context, baseImage string, platform *v1.Platform) (v1.Image, error)
}

ImageDownloader interface for downloading base images

type ImageSaver

type ImageSaver interface {
	SaveImage(ctx context.Context, img v1.Image, ref string) error
	SaveImageIndex(ctx context.Context, idx v1.ImageIndex, ref string) error
}

ImageSaver interface for saving built images to different destinations

type MultiArchBuildOptions added in v0.1.1

type MultiArchBuildOptions struct {
	Platforms              []*v1.Platform // Target platforms
	BaseImage              string         // Base image reference
	MCPToolDefinitionsPath string         // path to the MCP file
	MCPServerConfigPath    string         // path to the MCP server configuration file
	ImageTag               string         // output image tag
}

func (*MultiArchBuildOptions) SetDefaults added in v0.1.1

func (o *MultiArchBuildOptions) SetDefaults()

type OSFileSystem

type OSFileSystem struct{}

OSFileSystem implements FileSystem using the standard os package

func (*OSFileSystem) ReadFile

func (fs *OSFileSystem) ReadFile(name string) ([]byte, error)

func (*OSFileSystem) Stat

func (fs *OSFileSystem) Stat(name string) (fs.FileInfo, error)

type RegistryImageSaver

type RegistryImageSaver struct{}

RegistryImageSaver implements ImageSaver for pushing to container registries

func (*RegistryImageSaver) SaveImage

func (r *RegistryImageSaver) SaveImage(ctx context.Context, img v1.Image, ref string) error

func (*RegistryImageSaver) SaveImageIndex added in v0.1.1

func (r *RegistryImageSaver) SaveImageIndex(ctx context.Context, idx v1.ImageIndex, ref string) error

Jump to

Keyboard shortcuts

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