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 ¶
- func Connect(ctx context.Context, cfg Config) (*client.Client, error)
- func Create(ctx context.Context, cfg Config, use, bootstrap bool) (string, error)
- func Current() string
- func Remove(name string) error
- func RemoveBuildx(ctx context.Context, name string) error
- func Save(cfg Config) error
- func SetCurrent(name string) error
- func Use(ctx context.Context, name string) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
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
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 RemoveBuildx ¶ added in v1.1.0
RemoveBuildx removes a Docker Buildx builder instance.
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.
Click to show internal directories.
Click to hide internal directories.