builder

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeArgName

func EncodeArgName(name string) string

EncodeArgName encodes a variable name into a valid Docker ARG name. Docker ARG names must match ^[A-Za-z_][A-Za-z0-9_]*$. If the variable name is already valid, it is returned as-is. Otherwise, it is hashed using FNV-64a.

func NewBuildkitBuilder

func NewBuildkitBuilder(buildkitClient *client.Client, logger *slog.Logger) *builder

func NewSlogWriter

func NewSlogWriter(logger *slog.Logger, prefix string) io.Writer

func PutToEveryLayer

func PutToEveryLayer(dockerfile string, content string) (string, error)

Types

type BuildImageOptions

type BuildImageOptions struct {
	Dockerfile string
	Context    string
	Variables  map[string]string
}

type Builder

type Builder interface {
	Build(ctx context.Context, options BuildImageOptions) error
	BuildOCI(ctx context.Context, options BuildImageOptions, w io.WriteCloser) error
}

type EnvProcessor

type EnvProcessor struct {
	Variables []string
}

func (*EnvProcessor) Process

func (p *EnvProcessor) Process(ctx context.Context, dockerfile string) (string, error)

Process injects ARG and ENV statements to the Dockerfile.

It will inject the following statements:

ARG ZEABUR_ENV_XXX ZEABUR_ENV_YYY, ZEABUR_ENV_ZZZ
ENV XXX=${ZEABUR_ENV_XXX} YYY=${ZEABUR_ENV_YYY} ZZZ=${ZEABUR_ENV_ZZZ}

So you can pass the following build arguments to the build command:

ZEABUR_ENV_XXX=xxx ZEABUR_ENV_YYY=yyy ZEABUR_ENV_ZZZ=zzz

And the following environment variables will be set in the container:

XXX=xxx YYY=yyy ZZZ=zzz

type PipelineProcessor

type PipelineProcessor struct {
	Processors []Processor
}

func NewPipelineProcessor

func NewPipelineProcessor(processors ...Processor) *PipelineProcessor

func (*PipelineProcessor) Process

func (p *PipelineProcessor) Process(ctx context.Context, dockerfile string) (string, error)

type Processor

type Processor interface {
	Process(ctx context.Context, dockerfile string) (string, error)
}

Jump to

Keyboard shortcuts

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