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 ¶
- func GenerateIndexSBOM(ctx context.Context, o options.Options, ic types.ImageConfiguration, ...) ([]types.SBOM, error)
- func LockImageConfiguration(ctx context.Context, ic types.ImageConfiguration, opts ...Option) (map[string]*types.ImageConfiguration, map[string][]string, error)
- func LockImageConfigurationWithPackages(ctx context.Context, ic types.ImageConfiguration, opts ...Option) (map[string]*types.ImageConfiguration, map[string][]string, ...)
- func NewOptions(opts ...Option) (*options.Options, *types.ImageConfiguration, error)
- func WriteIndex(ctx context.Context, o *options.Options, idx v1.ImageIndex) (string, error)
- type Context
- func (bc *Context) APK() *apk.APK
- func (bc *Context) Arch() types.Architecture
- func (bc *Context) BaseImage() v1.Image
- func (bc *Context) BuildImage(ctx context.Context) error
- func (bc *Context) BuildLayer(ctx context.Context) (string, v1.Layer, error)
- func (bc *Context) BuildLayers(ctx context.Context) ([]v1.Layer, error)
- func (bc *Context) BuildPackageList(ctx context.Context) (toInstall []*apk.RepositoryPackage, conflicts []string, err error)
- func (bc *Context) GenerateImageSBOM(ctx context.Context, arch types.Architecture, img v1.Image) ([]types.SBOM, error)
- func (bc *Context) GetBuildDateEpoch() (time.Time, error)
- func (bc *Context) ImageConfiguration() types.ImageConfiguration
- func (bc *Context) ImageLayoutToLayer(ctx context.Context) (string, v1.Layer, error)
- func (bc *Context) InstalledPackages() ([]*apk.InstalledPackage, error)
- func (bc *Context) Resolve(ctx context.Context) ([]*apk.APKResolved, error)
- func (bc *Context) ResolveWithBase(ctx context.Context) ([]*apk.APKResolved, error)
- func (bc *Context) Summarize(ctx context.Context)
- func (bc *Context) TarballPath() string
- func (bc *Context) VerifyLockfileConsistency(ctx context.Context, lockConfig *lock.Config) error
- func (bc *Context) WantSBOM() bool
- func (bc *Context) WriteEtcApkoConfig(_ context.Context) error
- type MultiArch
- type Option
- func WithAnnotations(annotations map[string]string) Option
- func WithArch(arch types.Architecture) Option
- func WithAuthenticator(a auth.Authenticator) Option
- func WithBuildDate(s string) Option
- func WithCache(cacheDir string, offline bool, shared *apk.Cache) Option
- func WithCompressedLayerFile(enabled bool) Option
- func WithConfig(configFile string, includePaths []string) Option
- func WithExtraBuildRepos(repos []string) Option
- func WithExtraKeys(keys []string) Option
- func WithExtraPackages(packages []string) Option
- func WithExtraRepos(repos []string) Option
- func WithFormat(format string) Option
- func WithIgnoreSignatures(ignore bool) Option
- func WithImageConfiguration(ic types.ImageConfiguration) Option
- func WithIncludePaths(includePaths []string) Option
- func WithLockFile(lockFile string) Option
- func WithOffline(offline bool) Option
- func WithPackageGetter(pg apk.PackageGetter) Option
- func WithPreResolvedPackages(contents []apk.PackageContents) Option
- func WithSBOM(path string) Option
- func WithSBOMFormats(formats []string) Optiondeprecated
- func WithSBOMGenerators(generators ...generator.Generator) Option
- func WithSizeLimits(limits options.SizeLimits) Option
- func WithSourceDateEpoch(t time.Time) Option
- func WithTags(tags ...string) Option
- func WithTarball(path string) Option
- func WithTempDir(tmp string) Option
- func WithTransport(t http.RoundTripper) Option
- func WithVCS(enable bool) Option
- func WithoutDiskCache() Option
- type PathMutationFileConflictError
- type PathMutator
- type ReleaseData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateIndexSBOM ¶ added in v0.11.0
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 LockImageConfigurationWithPackages ¶ added in v1.1.8
func LockImageConfigurationWithPackages(ctx context.Context, ic types.ImageConfiguration, opts ...Option) (map[string]*types.ImageConfiguration, map[string][]string, map[types.Architecture][]*apk.RepositoryPackage, error)
LockImageConfigurationWithPackages is like LockImageConfiguration but additionally returns the resolved package metadata per architecture. The returned map contains the full RepositoryPackage objects as resolved by the solver. When a lockfile is used, the resolved packages map will be nil as the full package metadata is not available from lockfiles.
func NewOptions ¶ added in v0.10.0
NewOptions evaluates the build.Options in the same way as New().
func WriteIndex ¶ added in v0.11.0
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 configuration for 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
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) BuildLayer ¶
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) BuildLayers ¶ added in v0.25.6
BuildLayers is like BuildLayer but has the potential to return multiple layers.
func (*Context) BuildPackageList ¶ added in v0.7.0
func (*Context) GenerateImageSBOM ¶ added in v0.5.0
func (*Context) GetBuildDateEpoch ¶ added in v0.9.0
func (*Context) ImageConfiguration ¶
func (bc *Context) ImageConfiguration() types.ImageConfiguration
func (*Context) ImageLayoutToLayer ¶ added in v0.7.0
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) ResolveWithBase ¶ added in v0.14.1
func (*Context) TarballPath ¶
func (*Context) VerifyLockfileConsistency ¶ added in v0.27.2
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 (*MultiArch) BuildLayers ¶ added in v0.16.0
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
Option is an option for the build context.
func WithAnnotations ¶ added in v0.5.0
WithAnnotations adds annotations from commandline to those in the config. Commandline annotations take precedence, wherever this Option appears in the slice relative to WithImageConfiguration or WithConfig.
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
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
WithCache enables disk caching in cacheDir. An empty cacheDir uses the system cache directory.
func WithCompressedLayerFile ¶ added in v1.4.0
WithCompressedLayerFile writes each tar layer gzipped in a single pass, so peak scratch space is the compressed size and the returned layer file path holds gzip bytes rather than plain tar. Consumers that read tar bytes back through Uncompressed() pay a gunzip they did not pay before. It has no effect on erofs layers, which are written uncompressed.
func WithConfig ¶ added in v0.2.0
WithConfig sets the image configuration for the build context. The image configuration is parsed from given config file. Like WithImageConfiguration it replaces the configuration rather than merging into it. TODO(jason): Remove this.
func WithExtraBuildRepos ¶ added in v0.15.0
func WithExtraKeys ¶ added in v0.2.0
func WithExtraPackages ¶ added in v0.9.0
func WithExtraRepos ¶ added in v0.2.0
func WithFormat ¶ added in v1.2.38
WithFormat sets the layer payload format ("tar" or "erofs"). The value overrides any format declared in the image configuration, wherever this Option appears in the slice relative to WithImageConfiguration or WithConfig. Empty means "leave the configured value alone".
func WithIgnoreSignatures ¶ added in v0.16.0
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. It replaces the configuration rather than merging into it, so any earlier Option that set one of its fields directly is discarded. The field-level Options (WithFormat, WithAnnotations) are exempt: they are resolved after every Option has been applied.
func WithIncludePaths ¶ added in v0.15.0
func WithLockFile ¶ added in v0.13.0
func WithOffline ¶ added in v1.2.34
WithOffline controls whether network requests are permitted. Cached and local resources remain available in offline mode.
func WithPackageGetter ¶ added in v1.0.4
func WithPackageGetter(pg apk.PackageGetter) Option
WithPackageGetter sets a custom PackageGetter for fetching, expanding, and caching packages. If not provided, a DefaultPackageGetter will be created automatically.
func WithPreResolvedPackages ¶ added in v1.2.43
func WithPreResolvedPackages(contents []apk.PackageContents) Option
WithPreResolvedPackages provides the exact package set to install, in order, with the contents each member installs from. The build installs precisely these: no index is consulted and no dependency resolution happens — including for an empty set, which installs precisely nothing. The image configuration's package list still names the requested world (written to /etc/apk/world); this option settles how it is satisfied.
func WithSBOMFormats
deprecated
added in
v0.2.0
func WithSBOMGenerators ¶ added in v1.0.0
WithSBOMGenerators sets the SBOM generators to use.
func WithSizeLimits ¶ added in v1.1.0
func WithSizeLimits(limits options.SizeLimits) Option
WithSizeLimits sets the size limits for various operations.
func WithSourceDateEpoch ¶ added in v0.10.0
WithSourceDateEpoch is like WithBuildDate but not a string.
func WithTarball ¶ added in v0.2.0
WithTarball sets the output path of the layer tarball.
func WithTempDir ¶ added in v0.14.1
func WithTransport ¶ added in v0.24.0
func WithTransport(t http.RoundTripper) Option
WithTransport allows explicitly setting the inner HTTP transport.
func WithoutDiskCache ¶ added in v1.2.34
func WithoutDiskCache() Option
WithoutDiskCache keeps downloaded packages and repository indexes out of the filesystem cache. In-memory package-resolution caches remain available.
type PathMutationFileConflictError ¶ added in v0.30.24
type PathMutationFileConflictError struct {
// The full path of the file that has a conflict.
Path string
}
PathMutationFileConflictError is returned when a path mutation attempts to create a file that conflicts with an existing file. This is a user error in the image configuration.
func (*PathMutationFileConflictError) Error ¶ added in v0.30.24
func (e *PathMutationFileConflictError) Error() string
type PathMutator ¶ added in v0.3.0
type ReleaseData ¶ added in v0.22.7
func ParseReleaseData ¶ added in v0.28.0
func ParseReleaseData(osRelease io.Reader) (*ReleaseData, error)
ParseReleaseData reads the os-release data from the provided io.Reader