cib

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 20 Imported by: 5

Documentation

Overview

Package cib contains the primitives for container image building.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WalkRecursive added in v0.0.2

func WalkRecursive(ctx context.Context, ref client.Reference, walkFn WalkFunc) error

WalkRecursive iterates all the files in the reference recursively.

Types

type Service

type Service interface {
	// GetOpts returns client options.
	GetOpts() map[string]string
	// GetCaps returns the capabilities of the service.
	GetCaps() apicaps.CapSet
	// GetMarshalOpts returns options for marshalling LLB.
	GetMarshalOpts() []llb.ConstraintsOpt
	// GetResolveMode returns the resolution mode for base images.
	GetResolveMode() (llb.ResolveMode, error)
	// GetMetadataFileName returns the name for the metadata file.
	GetMetadataFileName() string
	// GetMetadata returns the contents of the metadata file.
	GetMetadata() ([]byte, error)
	// GetExcludes returns the list of paths to exclude from the build context.
	GetExcludes() ([]string, error)
	// GetBuildArgs returns the list of build-time variables.
	GetBuildArgs() map[string]string
	// GetBuildPlatform returns the build platform for the client.
	GetBuildPlatform() *specs.Platform
	// GetTargetPlatforms returns the list of target platforms for the image(s) being built.
	GetTargetPlatforms() ([]*specs.Platform, error)
	// GetIsMultiPlatform returns true if this is a multi-platform build and false otherwise.
	GetIsMultiPlatform() (bool, error)
	// GetCacheImports returns the list of external cache sources to use in the build.
	GetCacheImports() ([]client.CacheOptionsEntry, error)
	// GetIgnoreCache indicates whether the cache should be ignored.
	GetIgnoreCache() bool

	// Src returns the reference to the source code (created lazily).
	Src() (ref client.Reference, err error)
	// SrcState returns the LLB state of the source code (created lazily).
	SrcState() (state llb.State, err error)

	// FetchImageConfig returns the configuration of the image for the given platform.
	FetchImageConfig(name string, platform *specs.Platform) (dockerfile2llb.Image, error)
	// From creates a new LLB state from the specified base image.
	From(base string, platform *specs.Platform, comment string) (llb.State, *dockerfile2llb.Image, error)
	// Solve the provided LLB state and return a single reference from it.
	Solve(ctx context.Context, state llb.State) (client.Reference, error)
}

Service that wraps low-level BuildKit actions and provides a simple interface for container image build.

func NewService

func NewService(ctx context.Context, client client.Client) Service

NewService creates an instance of container image building service.

type WalkFunc added in v0.0.2

type WalkFunc func(file *fsutil.Stat) error

WalkFunc is the type of function called for each file or directory visited by WalkRecursive.

Directories

Path Synopsis
Package cib_mock is a generated GoMock package.
Package cib_mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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