build

package
v0.22.4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 54 Imported by: 7

Documentation

Overview

Code generated by go generate; DO NOT EDIT. This file was generated by go:generate at 2023-03-17 13:31:54.534502 +0200 IST m=+21.073851668

DO NOT EDIT!

To regenerate, run

go generate

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateIndexSBOM added in v0.11.0

func GenerateIndexSBOM(ctx context.Context, o options.Options, ic types.ImageConfiguration, indexDigest name.Digest, imgs map[types.Architecture]oci.SignedImage) ([]types.SBOM, error)

func LockImageConfiguration added in v0.18.0

func LockImageConfiguration(ctx context.Context, ic types.ImageConfiguration, opts ...Option) (map[string]*types.ImageConfiguration, map[string][]string, error)

LockImageConfiguration returns a map of locked image configurations for each architecture, plus an entry for the "index" pseudo-architecture that represents the intersection of packages across all the real architecture configs. It also returns a map of missing packages for each architecture that could not be locked. Using the "index" architecture is equivalent to what this used to return prior to supporting per-arch locked configs.

func NewOptions added in v0.10.0

func NewOptions(opts ...Option) (*options.Options, *types.ImageConfiguration, error)

NewOptions evaluates the build.Options in the same way as New().

func WriteIndex added in v0.11.0

func WriteIndex(ctx context.Context, o *options.Options, idx oci.SignedImageIndex) (string, error)

WriteIndex saves the index file from the given image configuration.

Types

type Context

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

Context contains all of the information necessary to build an OCI image. Includes the configurationfor the build, the path to the config file, the executor for root jails and architecture emulation, the s6 supervisor to add to the image, build options, and the `buildImplementation`, which handles the actual build.

func New added in v0.2.0

func New(ctx context.Context, fs apkfs.FullFS, opts ...Option) (*Context, error)

New creates a build context. The SOURCE_DATE_EPOCH env variable is supported and will overwrite the provided timestamp if present.

func (*Context) Arch added in v0.2.0

func (bc *Context) Arch() types.Architecture

func (*Context) BaseImage added in v0.14.1

func (bc *Context) BaseImage() v1.Image

func (*Context) BuildImage

func (bc *Context) BuildImage(ctx context.Context) error

func (*Context) BuildLayer

func (bc *Context) BuildLayer(ctx context.Context) (string, v1.Layer, error)

BuildLayer given the context set up, including build configuration and working directory, lays out all of the packages in the working directory, sets up the necessary user accounts and groups, and sets everything up in the directory. Then packages it all up into a standard OCI image layer tar.gz file.

func (*Context) BuildPackageList added in v0.7.0

func (bc *Context) BuildPackageList(ctx context.Context) (toInstall []*apk.RepositoryPackage, conflicts []string, err error)

func (*Context) BuildTarball

func (bc *Context) BuildTarball(ctx context.Context) (string, hash.Hash, hash.Hash, int64, error)

BuildTarball takes the fully populated working directory and saves it to an OCI image layer tar.gz file.

func (*Context) GenerateImageSBOM added in v0.5.0

func (bc *Context) GenerateImageSBOM(ctx context.Context, arch types.Architecture, img oci.SignedImage) ([]types.SBOM, error)

func (*Context) GetBuildDateEpoch added in v0.9.0

func (bc *Context) GetBuildDateEpoch() (time.Time, error)

func (*Context) ImageConfiguration

func (bc *Context) ImageConfiguration() types.ImageConfiguration

func (*Context) ImageLayoutToLayer added in v0.7.0

func (bc *Context) ImageLayoutToLayer(ctx context.Context) (string, v1.Layer, error)

ImageLayoutToLayer given an already built-out image in an fs from BuildImage(), create an OCI image layer tgz.

func (*Context) InstalledPackages added in v0.9.0

func (bc *Context) InstalledPackages() ([]*apk.InstalledPackage, error)

func (*Context) Resolve added in v0.11.0

func (bc *Context) Resolve(ctx context.Context) ([]*apk.APKResolved, error)

func (*Context) ResolveWithBase added in v0.14.1

func (bc *Context) ResolveWithBase(ctx context.Context) ([]*apk.APKResolved, error)

func (*Context) Summarize

func (bc *Context) Summarize(ctx context.Context)

func (*Context) TarballPath

func (bc *Context) TarballPath() string

func (*Context) WantSBOM added in v0.2.0

func (bc *Context) WantSBOM() bool

func (*Context) WriteEtcApkoConfig added in v0.20.0

func (bc *Context) WriteEtcApkoConfig(_ context.Context) error

type MultiArch added in v0.16.0

type MultiArch struct {
	Contexts map[types.Architecture]*Context
}

MultiArch is a build context that can be used to build a multi-architecture image. It is used to coordinate the solvers across architectures to ensure they have a consistent solution. It does this by disqualifying any packages that are not present in other architectures.

func NewMultiArch added in v0.16.0

func NewMultiArch(ctx context.Context, archs []types.Architecture, opts ...Option) (*MultiArch, error)

func (*MultiArch) BuildLayers added in v0.16.0

func (m *MultiArch) BuildLayers(ctx context.Context) (map[types.Architecture]v1.Layer, error)

func (*MultiArch) BuildPackageLists added in v0.17.0

func (m *MultiArch) BuildPackageLists(ctx context.Context) (map[types.Architecture][]*apk.RepositoryPackage, error)

type Option added in v0.2.0

type Option func(*Context) error

Option is an option for the build context.

func WithAnnotations added in v0.5.0

func WithAnnotations(annotations map[string]string) Option

WithAnnotations adds annotations from commandline to those in the config. Commandline annotations take precedence.

func WithArch added in v0.2.0

func WithArch(arch types.Architecture) Option

WithArch sets the architecture for the build context.

func WithAuthenticator added in v0.16.0

func WithAuthenticator(a auth.Authenticator) Option

func WithBuildDate added in v0.2.0

func WithBuildDate(s string) Option

WithBuildDate sets the timestamps for the build context. The string is parsed according to RFC3339. An empty string is a special case and will default to the unix epoch.

func WithCache added in v0.19.3

func WithCache(cacheDir string, offline bool, shared *apk.Cache) Option

WithCache set the cache directory to use

func WithConfig added in v0.2.0

func WithConfig(configFile string, includePaths []string) Option

WithConfig sets the image configuration for the build context. The image configuration is parsed from given config file. TODO(jason): Remove this. Deprecated: Use WithImageConfiguration instead.

func WithExtraBuildRepos added in v0.15.0

func WithExtraBuildRepos(repos []string) Option

func WithExtraKeys added in v0.2.0

func WithExtraKeys(keys []string) Option

func WithExtraPackages added in v0.9.0

func WithExtraPackages(packages []string) Option

func WithExtraRuntimeRepos added in v0.15.0

func WithExtraRuntimeRepos(repos []string) Option

func WithIgnoreSignatures added in v0.16.0

func WithIgnoreSignatures(ignore bool) Option

WithIgnoreSignatures sets whether to ignore repository signature verification. Default is false.

func WithImageConfiguration added in v0.2.0

func WithImageConfiguration(ic types.ImageConfiguration) Option

WithImageConfiguration sets the ImageConfiguration object to use when building.

func WithIncludePaths added in v0.15.0

func WithIncludePaths(includePaths []string) Option

func WithLockFile added in v0.13.0

func WithLockFile(lockFile string) Option

func WithSBOM added in v0.2.0

func WithSBOM(path string) Option

func WithSBOMFormats added in v0.2.0

func WithSBOMFormats(formats []string) Option

func WithSourceDateEpoch added in v0.10.0

func WithSourceDateEpoch(t time.Time) Option

WithSourceDateEpoch is like WithBuildDate but not a string.

func WithTags added in v0.2.0

func WithTags(tags ...string) Option

WithTags sets the tags for the build context.

func WithTarball added in v0.2.0

func WithTarball(path string) Option

WithTarball sets the output path of the layer tarball.

func WithTempDir added in v0.14.1

func WithTempDir(tmp string) Option

func WithVCS added in v0.5.0

func WithVCS(enable bool) Option

WithVCS enables VCS URL probing for the build context.

type PathMutator added in v0.3.0

type PathMutator func(apkfs.FullFS, *options.Options, types.PathMutation) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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