build

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildResult

type BuildResult struct {
	Entrypoint     string // The entrypoint (from stack or image ENTRYPOINT)
	Command        string // The command (from image CMD)
	ManifestDigest string
	WorkingDir     string
}

type BuildStack

type BuildStack struct {
	Stack   string
	CodeDir string
	Input   string

	Version     string
	OnBuild     []string
	AlpineImage string
}

type Builder

type Builder struct {
	Log *slog.Logger
	EAS *entityserver_v1alpha.EntityAccessClient

	TempDir     string
	Registry    string
	DNSHostname string // Cloud-provisioned DNS hostname for default route display

	Resolver  netresolve.Resolver
	LogWriter observability.LogWriter

	// BuildKit is the persistent BuildKit component for container image builds.
	// When set, uses the shared daemon instead of launching ephemeral sandboxes.
	BuildKit *buildkit.Component
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(log *slog.Logger, eas *entityserver_v1alpha.EntityAccessClient, appClient *app.Client, res netresolve.Resolver, tmpdir string, logWriter observability.LogWriter, dnsHostname string, bk *buildkit.Component) *Builder

func (*Builder) AnalyzeApp added in v0.2.0

func (b *Builder) AnalyzeApp(ctx context.Context, state *build_v1alpha.BuilderAnalyzeApp) error

AnalyzeApp analyzes an app without building it, returning detected stack, services, and configuration.

func (*Builder) BuildFromTar

func (b *Builder) BuildFromTar(ctx context.Context, state *build_v1alpha.BuilderBuildFromTar) error

type Buildkit

type Buildkit struct {
	Client *client.Client

	Log *slog.Logger

	// RegistryURLOverride is used for fetching image configs when the push URL
	// is not accessible from the current host (e.g., in tests where push goes to
	// a docker network address but fetch needs localhost:port)
	RegistryURLOverride string
}

func (*Buildkit) BuildImage

func (b *Buildkit) BuildImage(
	ctx context.Context,
	dfs fsutil.FS,
	bs BuildStack,
	app, imageURL string,
	tos ...TransformOptions,
) (*BuildResult, error)

func (*Buildkit) Transform

func (b *Buildkit) Transform(ctx context.Context, dfs fsutil.FS, tos ...TransformOptions) (io.ReadCloser, chan struct{}, error)

type ConfigInputs added in v0.2.0

type ConfigInputs struct {
	// BuildResult contains entrypoint, working dir, and image entrypoint/cmd from the build
	BuildResult *BuildResult

	// AppConfig is the parsed app.toml configuration (may be nil)
	AppConfig *appconfig.AppConfig

	// ProcfileServices maps service names to commands from the Procfile (may be nil)
	ProcfileServices map[string]string

	// ExistingConfig is the current config to preserve manual env vars from
	ExistingConfig core_v1alpha.Config
}

ConfigInputs holds all the inputs needed to build an app version config.

type ImageConfig

type ImageConfig struct {
	Services map[string]string
}

type TransformOptions

type TransformOptions func(*transformOpt)

func WithBuildArg

func WithBuildArg(key, val string) TransformOptions

func WithBuildArgs

func WithBuildArgs(args map[string]string) TransformOptions

func WithCacheDir

func WithCacheDir(dir string) TransformOptions

func WithPhaseUpdates

func WithPhaseUpdates(fn func(phase string)) TransformOptions

func WithStatusUpdates

func WithStatusUpdates(fn func(ss *client.SolveStatus, sj []byte)) TransformOptions

Jump to

Keyboard shortcuts

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