builder

package
v0.0.0-...-8fc2537 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: Apache-2.0 Imports: 61 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Key is a name of the github plugin variable
	Key      = Namespace("builder")
	KeySetup = "Setup"
	KeyBuild = "Build"
	KeyPush  = "Push"
	KeyPrune = "Prune"
)
View Source
const (
	// NativeBackend defines the native backend.
	NativeBackend = "native"
	// OverlayFSBackend defines the overlayfs backend.
	OverlayFSBackend = "overlayfs"
	// RuncExecutor is a name of runc directory executor
	RuncExecutor = "runc"
	// SessionName is a default session name
	SessionName = "img"
	// FrontendDockerfile is a name of the buildkit frontend
	FrontendDockerfile = "dockerfile.v0"
)
View Source
const (
	// CurrentDir is a notation for current dir
	CurrentDir = "."
	// Dockerfile is a standard dockerfile name
	Dockerfile = "Dockerfile"
)

Variables

This section is empty.

Functions

func RuncBinaryExists

func RuncBinaryExists(ctx context.Context) error

RuncBinaryExists checks if the runc binary exists. TODO(jessfraz): check if it's the right version as well.

func Scope

func Scope() (force.Group, error)

Scope returns a new scope with all the functions and structs defined, this is the entrypoint into plugin as far as force is concerned

Types

type Arg

type Arg struct {
	// Key is a build argument key
	Key string
	// Val is a build argument value
	Val string
}

func (*Arg) CheckAndSetDefaults

func (a *Arg) CheckAndSetDefaults() error

type BuildAction

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

BuildAction specifies biuldkit driven docker builds

func (*BuildAction) Eval

func (b *BuildAction) Eval(ctx force.ExecutionContext) (interface{}, error)

Eval runs build process

func (*BuildAction) MarshalCode

func (b *BuildAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)

MarshalCode marshals the action into code representation

func (*BuildAction) String

func (b *BuildAction) String() string

func (*BuildAction) Type

func (b *BuildAction) Type() interface{}

type Builder

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

Builder is a new container image builder

func New

func New(cfg Config) (*Builder, error)

New returns a new builder

func (*Builder) Credentials

func (*Builder) Eval

func (b *Builder) Eval(ectx force.ExecutionContext, iface interface{}) (interface{}, error)

Eval runs build

func (*Builder) Prune

func (b *Builder) Prune(ectx force.ExecutionContext) (interface{}, error)

Prune clears build cache

func (*Builder) Push

func (b *Builder) Push(ectx force.ExecutionContext, iface interface{}) (interface{}, error)

Push pushes image to remote registry

func (*Builder) Register

func (b *Builder) Register(server *grpc.Server)

func (*Builder) Session

Session creates the session manager and returns the session and it's dialer.

type Config

type Config struct {
	// Context is an execution context for the plugin setup
	Context force.ExecutionContext `code:"-"`
	// Group is a process group that this plugin sets up for
	Group force.Group `code:"-"`
	// GlobalContext is a base directory path for overlayfs other types
	// of snapshotting
	GlobalContext string
	// Backend specifies build backend
	Backend string
	// SessionName is a default build session name
	SessionName string
	// Server is an optional registry server to login into
	Server string
	// Username is the registry username
	Username string
	// Secret is a registry secret
	Secret string
	// SecretFile is a path to registry secret file
	SecretFile string
	// Insecure turns off security for image pull/push
	Insecure bool
}

Config specifies builder config

func (*Config) CheckAndSetDefaults

func (cfg *Config) CheckAndSetDefaults() error

CheckAndSetDefaults checks and sets default values

type Image

type Image struct {
	// Context is a path or URL to the bulid context
	Context string
	// Dockerfile is a path or the URL to the dockerfile
	Dockerfile string
	// Tag is a tag in the spec of image:tag (optional tag part)
	Tag string
	// NoCache turns off caching
	NoCache bool
	// Platforms is a list of target platforms
	Platforms []string
	// Target is the target build stage to build
	Target string
	// Secrets is a list of secrets
	// mounted in the build container
	Secrets []Secret
	// Args is a list of the build arguments
	Args []Arg
}

Image specifies docker image to build

func (*Image) CheckAndSetDefaults

func (i *Image) CheckAndSetDefaults() error

CheckAndSetDefaults checks and sets default values

func (Image) String

func (i Image) String() string

type Namespace

type Namespace string

Namespace is a wrapper around string to namespace a variable

type NewBuild

type NewBuild struct {
}

NewBuild creates build actions

func (*NewBuild) NewInstance

func (n *NewBuild) NewInstance(group force.Group) (force.Group, interface{})

NewInstance creates functions creating new Build action

type NewPrune

type NewPrune struct {
}

NewPrune specifies prune action - cleaning up dangled leftovers from builds - images and tags, layers

func (*NewPrune) NewInstance

func (n *NewPrune) NewInstance(group force.Group) (force.Group, interface{})

NewInstance returns function creating new prune actions

type NewPush

type NewPush struct {
}

NewPush specifies new push actions

func (*NewPush) NewInstance

func (n *NewPush) NewInstance(group force.Group) (force.Group, interface{})

NewInstance returns functions creating new push action

type PruneAction

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

PruneAction prunes all leftover build layers and snapshots from the local storage

func (*PruneAction) Eval

func (p *PruneAction) Eval(ctx force.ExecutionContext) (interface{}, error)

Eval runs prune action

func (*PruneAction) MarshalCode

func (p *PruneAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)

MarshalCode marshals the action into code representation

func (*PruneAction) String

func (p *PruneAction) String() string

func (*PruneAction) Type

func (p *PruneAction) Type() interface{}

type PushAction

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

PushAction returns new push actions

func (*PushAction) Eval

func (p *PushAction) Eval(ctx force.ExecutionContext) (interface{}, error)

Eval pushes image to remote repository

func (*PushAction) MarshalCode

func (p *PushAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)

MarshalCode marshals the action into code representation

func (*PushAction) String

func (b *PushAction) String() string

func (*PushAction) Type

func (p *PushAction) Type() interface{}

type Secret

type Secret struct {
	// ID is a secret ID
	ID string
	// File is a path to a secret
	File string
}

Secret is a secret passed to docker builds

func (*Secret) CheckAndSetDefaults

func (s *Secret) CheckAndSetDefaults() error

type Setup

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

Setup specifies builder plugins

func (*Setup) Eval

func (n *Setup) Eval(ctx force.ExecutionContext) (interface{}, error)

Eval sets up plugin for the given process group

func (*Setup) MarshalCode

func (n *Setup) MarshalCode(ctx force.ExecutionContext) ([]byte, error)

MarshalCode marshals plugin to code representation

func (*Setup) NewInstance

func (n *Setup) NewInstance(group force.Group) (force.Group, interface{})

NewInstance returns function creating new plugins based on configs

func (*Setup) Type

func (n *Setup) Type() interface{}

Jump to

Keyboard shortcuts

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