builder

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package builder manages kforge builder instances. Configs are stored in ~/.kforge/builders/ as JSON files. The active builder name is tracked in ~/.kforge/current.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(ctx context.Context, cfg Config) (*client.Client, error)

Connect returns a BuildKit client for the given builder config.

For "docker-container" driver:

The BuildKit daemon runs inside a Docker container named
buildx_buildkit_<name>0  (same naming convention as docker buildx).
We use the "docker-container://<name>" scheme which tells the BuildKit
client to reach the daemon via the Docker API — NOT via a raw gRPC socket.
The container is auto-bootstrapped if it is not already running.

For "remote" driver:

Connects directly to Endpoint (e.g. tcp://host:1234).

func Create added in v1.1.0

func Create(ctx context.Context, cfg Config, use, bootstrap bool) (string, error)

Create provisions a Docker Buildx builder and returns the raw builder ID/name.

func Current

func Current() string

Current returns the name of the active builder. Returns "default" if none is set.

func Remove

func Remove(name string) error

Remove deletes a builder config by name.

func RemoveBuildx added in v1.1.0

func RemoveBuildx(ctx context.Context, name string) error

RemoveBuildx removes a Docker Buildx builder instance.

func Save

func Save(cfg Config) error

Save persists a builder config to disk.

func SetCurrent

func SetCurrent(name string) error

SetCurrent sets the active builder by name.

func Use added in v1.1.0

func Use(ctx context.Context, name string) error

Use activates a Docker Buildx builder.

Types

type Config

type Config struct {
	Name      string   `json:"name"`
	Driver    string   `json:"driver"`             // "docker-container" or "remote"
	Endpoint  string   `json:"endpoint,omitempty"` // only used by remote driver
	Platforms []string `json:"platforms,omitempty"`
}

Config holds the configuration for a single builder instance.

func List

func List() ([]Config, error)

List returns all saved builder configs.

func Load

func Load(name string) (Config, error)

Load reads a builder config by name.

Jump to

Keyboard shortcuts

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