stackbuild

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildOptions

type BuildOptions struct {
	Log interface{ Info(string, ...any) }

	// Name is the name of the application being built
	Name string

	// Version specifies the language/runtime version to use
	// If empty, defaults to latest stable version
	Version string

	// CacheNS specifies the namespace for persistent cache mounts
	CacheNS string

	// The alpine image to use for the base image.
	AlpineImage string

	OnBuild []string

	// EnvVars are user-configured environment variables to inject into build steps
	// (onBuild commands, asset precompilation). These are set on intermediate LLB
	// states only and do not persist to the final image config.
	EnvVars map[string]string
}

BuildOptions contains configuration for stack builds

type BunStack

type BunStack struct {
	MetaStack
	// contains filtered or unexported fields
}

BunStack implements Stack for Bun

func (*BunStack) Detect

func (s *BunStack) Detect() bool

func (*BunStack) GenerateLLB

func (s *BunStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*BunStack) Init added in v0.2.0

func (s *BunStack) Init(opts BuildOptions)

func (*BunStack) Name

func (s *BunStack) Name() string

func (*BunStack) WebCommand added in v0.2.0

func (s *BunStack) WebCommand() string

type DetectionEvent added in v0.2.0

type DetectionEvent struct {
	Kind    string // e.g., "file", "package", "framework", "config"
	Name    string // e.g., "Gemfile", "rails", "puma"
	Message string // Human-readable description
}

DetectionEvent represents something detected during stack analysis

type GoStack

type GoStack struct {
	MetaStack
	// contains filtered or unexported fields
}

GoStack implements Stack for Go

func (*GoStack) Detect

func (s *GoStack) Detect() bool

func (*GoStack) GenerateLLB

func (s *GoStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*GoStack) Init added in v0.2.0

func (s *GoStack) Init(opts BuildOptions)

func (*GoStack) Name

func (s *GoStack) Name() string

func (*GoStack) WebCommand added in v0.2.0

func (s *GoStack) WebCommand() string

type MetaStack

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

MetaStack provides shared functionality for all stack implementations

func (*MetaStack) AddEnv

func (s *MetaStack) AddEnv(key, value string)

func (*MetaStack) Entrypoint

func (s *MetaStack) Entrypoint() string

func (*MetaStack) Event added in v0.2.0

func (s *MetaStack) Event(kind, name, message string)

Event adds a detection event

func (*MetaStack) Events added in v0.2.0

func (s *MetaStack) Events() []DetectionEvent

Events returns all detection events

func (*MetaStack) Image

func (s *MetaStack) Image() ocispecs.Image

func (*MetaStack) Init added in v0.2.0

func (s *MetaStack) Init(opts BuildOptions)

func (*MetaStack) SetCmd

func (s *MetaStack) SetCmd(cmd []string)

func (*MetaStack) SetCwd

func (s *MetaStack) SetCwd(cwd string)

func (*MetaStack) SetEntrypoint

func (s *MetaStack) SetEntrypoint(ep []string)

type NodeStack

type NodeStack struct {
	MetaStack
	// contains filtered or unexported fields
}

NodeStack implements Stack for Node.js

func (*NodeStack) Detect

func (s *NodeStack) Detect() bool

func (*NodeStack) GenerateLLB

func (s *NodeStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*NodeStack) Init added in v0.2.0

func (s *NodeStack) Init(opts BuildOptions)

func (*NodeStack) Name

func (s *NodeStack) Name() string

func (*NodeStack) WebCommand added in v0.2.0

func (s *NodeStack) WebCommand() string

type PythonStack

type PythonStack struct {
	MetaStack
	// contains filtered or unexported fields
}

PythonStack implements Stack for Python

func (*PythonStack) Detect

func (s *PythonStack) Detect() bool

func (*PythonStack) Entrypoint

func (s *PythonStack) Entrypoint() string

func (*PythonStack) GenerateLLB

func (s *PythonStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*PythonStack) Init added in v0.2.0

func (s *PythonStack) Init(opts BuildOptions)

func (*PythonStack) Name

func (s *PythonStack) Name() string

func (*PythonStack) WebCommand added in v0.2.0

func (s *PythonStack) WebCommand() string

type RubyStack

type RubyStack struct {
	MetaStack
	// contains filtered or unexported fields
}

RubyStack implements Stack for Ruby on Rails

func (*RubyStack) Detect

func (s *RubyStack) Detect() bool

func (*RubyStack) Entrypoint

func (s *RubyStack) Entrypoint() string

func (*RubyStack) Gemfile

func (s *RubyStack) Gemfile() ([]byte, []byte, error)

func (*RubyStack) GenerateLLB

func (s *RubyStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*RubyStack) Init added in v0.2.0

func (s *RubyStack) Init(opts BuildOptions)

func (*RubyStack) Name

func (s *RubyStack) Name() string

func (*RubyStack) WebCommand added in v0.2.0

func (s *RubyStack) WebCommand() string

type RustStack added in v0.2.0

type RustStack struct {
	MetaStack
	// contains filtered or unexported fields
}

RustStack implements Stack for Rust

func (*RustStack) Detect added in v0.2.0

func (s *RustStack) Detect() bool

func (*RustStack) GenerateLLB added in v0.2.0

func (s *RustStack) GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

func (*RustStack) Init added in v0.2.0

func (s *RustStack) Init(opts BuildOptions)

func (*RustStack) Name added in v0.2.0

func (s *RustStack) Name() string

func (*RustStack) WebCommand added in v0.2.0

func (s *RustStack) WebCommand() string

type Stack

type Stack interface {
	Name() string
	// Detect returns true if the given directory contains code for this stack
	Detect() bool
	// Init is called after detection to perform common initialization
	Init(opts BuildOptions)
	// GenerateLLB creates the BuildKit LLB for building this stack
	GenerateLLB(dir string, opts BuildOptions) (*llb.State, error)

	Image() ocispecs.Image

	Entrypoint() string

	// WebCommand returns the default command for the web service in a Procfile
	WebCommand() string

	// Events returns detection events collected during Detect() and Init()
	Events() []DetectionEvent
}

Stack represents a programming language/framework stack

func DetectStack

func DetectStack(dir string, opts BuildOptions) (Stack, error)

DetectStack identifies the programming stack in the given directory

Jump to

Keyboard shortcuts

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