Documentation
¶
Overview ¶
Package buildkit provides a component for managing a persistent BuildKit daemon using containerd. BuildKit is used for building container images with layer caching across builds.
Index ¶
- type Component
- func (c *Component) Client(ctx context.Context) (*buildkitclient.Client, error)
- func (c *Component) IsRunning() bool
- func (c *Component) SetRegistryIP(ip string) error
- func (c *Component) SocketPath() string
- func (c *Component) Start(ctx context.Context, config Config) error
- func (c *Component) Stop(ctx context.Context) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
Log *slog.Logger
CC *containerd.Client
Namespace string
DataPath string
// contains filtered or unexported fields
}
Component manages a persistent BuildKit daemon as a containerd container, or connects to an external BuildKit daemon via Unix socket.
func NewComponent ¶
NewComponent creates a new BuildKit component that manages an embedded daemon.
func NewExternalComponent ¶
NewExternalComponent creates a BuildKit component that connects to an external daemon. No container lifecycle management is performed - it only provides client access.
func (*Component) SetRegistryIP ¶
SetRegistryIP updates the hosts file with the registry IP address for cluster.local. This can be called after Start() once the registry IP is known.
func (*Component) SocketPath ¶
SocketPath returns the path to the BuildKit Unix socket.
type Config ¶
type Config struct {
// SocketDir is the directory where the Unix socket will be created (e.g., /run/miren/buildkit)
SocketDir string
// RegistryIP is the IP address for cluster.local registry (optional, can be set later via SetRegistryIP)
RegistryIP string
// GCKeepStorage is the maximum bytes of cache to keep (default: 10GB)
GCKeepStorage int64
// GCKeepDuration is how long to keep cache entries in seconds (default: 7 days)
GCKeepDuration int64
// RegistryHost is the hostname for the cluster-local registry (e.g., cluster.local:5000)
RegistryHost string
}
Config contains configuration for the BuildKit component.