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 ¶
- Variables
- func GenerateIndexSBOM(ctx context.Context, o options.Options, ic types.ImageConfiguration, ...) ([]types.SBOM, error)
- func GenerateOSRelease(fsys apkfs.FullFS, o *options.Options, ic *types.ImageConfiguration) error
- func NewOptions(opts ...Option) (*options.Options, *types.ImageConfiguration, error)
- func WriteIndex(o *options.Options, idx oci.SignedImageIndex) (string, error)
- type Assertion
- type Context
- func (bc *Context) Arch() types.Architecture
- func (bc *Context) BuildImage(ctx context.Context) error
- func (bc *Context) BuildLayer(ctx context.Context) (string, v1.Layer, error)
- func (bc *Context) BuildPackageList(ctx context.Context) (toInstall []*repository.RepositoryPackage, conflicts []string, err error)
- func (bc *Context) BuildTarball(ctx context.Context) (string, hash.Hash, hash.Hash, int64, error)
- func (bc *Context) GenerateImageSBOM(ctx context.Context, arch types.Architecture, img oci.SignedImage) ([]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) Logger() log.Logger
- func (bc *Context) Resolve(ctx context.Context) ([]*apk.APKResolved, error)
- func (bc *Context) Summarize()
- func (bc *Context) TarballPath() string
- func (bc *Context) TempDir() string
- func (bc *Context) WantSBOM() bool
- type Option
- func WithAnnotations(annotations map[string]string) Option
- func WithArch(arch types.Architecture) Option
- func WithAssertions(a ...Assertion) Option
- func WithBuildDate(s string) Option
- func WithCacheDir(cacheDir string, offline bool) Option
- func WithConfig(configFile string) Option
- func WithDebugLogging(enable bool) Option
- func WithDockerMediatypes(useDockerMediaTypes bool) Option
- func WithExtraKeys(keys []string) Option
- func WithExtraPackages(packages []string) Option
- func WithExtraRepos(repos []string) Option
- func WithImageConfiguration(ic types.ImageConfiguration) Option
- func WithLogger(logger log.Logger) Option
- func WithSBOM(path string) Option
- func WithSBOMFormats(formats []string) Option
- func WithSourceDateEpoch(t time.Time) Option
- func WithTags(tags ...string) Option
- func WithTarball(path string) Option
- func WithVCS(enable bool) Option
- type PathMutator
Constants ¶
This section is empty.
Variables ¶
var ErrOSReleaseAlreadyPresent = errors.New("already present")
ErrOSReleaseAlreadyPresent indicates /etc/os-release is already present.
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 GenerateOSRelease ¶ added in v0.10.0
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 Assertion ¶ added in v0.2.0
func RequireGroupFile ¶ added in v0.2.0
func RequirePasswdFile ¶ added in v0.2.0
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
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) BuildPackageList ¶ added in v0.7.0
func (bc *Context) BuildPackageList(ctx context.Context) (toInstall []*repository.RepositoryPackage, conflicts []string, err error)
func (*Context) BuildTarball ¶
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 (*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) TarballPath ¶
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.
func WithArch ¶ added in v0.2.0
func WithArch(arch types.Architecture) Option
WithArch sets the architecture for the build context.
func WithAssertions ¶ added in v0.2.0
WithAssertions adds assertions to validate the result of this build context. Assertions are checked in parallel at the end of the build process.
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 WithCacheDir ¶ added in v0.9.0
WithCacheDir set the cache directory to use
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.
func WithDebugLogging ¶ added in v0.5.0
WithDebugLogging sets the debug log level for the build context.
func WithDockerMediatypes ¶ added in v0.4.0
WithDockerMediatypes determine whether to use Docker mediatypes for the build context.
func WithExtraKeys ¶ added in v0.2.0
func WithExtraPackages ¶ added in v0.9.0
func WithExtraRepos ¶ added in v0.2.0
func WithImageConfiguration ¶ added in v0.2.0
func WithImageConfiguration(ic types.ImageConfiguration) Option
WithImageConfiguration sets the ImageConfiguration object to use when building.
func WithLogger ¶ added in v0.8.0
WithLogger sets the log.Logger implementation to be used by the build context.
func WithSBOMFormats ¶ added in v0.2.0
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.