Documentation ¶
Index ¶
- Constants
- Variables
- func SupportedLinuxArchitecture(arch string) bool
- type APISet
- type APIVersions
- type Blob
- type Builder
- func (b *Builder) AddBuildpack(bp buildpack.BuildModule)
- func (b *Builder) AddBuildpacks(main buildpack.BuildModule, dependencies []buildpack.BuildModule)
- func (b *Builder) AddExtension(bp buildpack.BuildModule)
- func (b *Builder) AllModules(kind string) []buildpack.BuildModule
- func (b *Builder) BaseImageName() string
- func (b *Builder) Buildpacks() []dist.ModuleInfo
- func (b *Builder) CreatedBy() CreatorMetadata
- func (b *Builder) DefaultRunImage() RunImageMetadata
- func (b *Builder) Description() string
- func (b *Builder) Extensions() []dist.ModuleInfo
- func (b *Builder) FlattenedModules(kind string) [][]buildpack.BuildModule
- func (b *Builder) GID() int
- func (b *Builder) Image() imgutil.Image
- func (b *Builder) LifecycleDescriptor() LifecycleDescriptor
- func (b *Builder) Mixins() []string
- func (b *Builder) Name() string
- func (b *Builder) Order() dist.Order
- func (b *Builder) OrderExtensions() dist.Order
- func (b *Builder) RunImages() []RunImageMetadata
- func (b *Builder) Save(logger logging.Logger, creatorMetadata CreatorMetadata) error
- func (b *Builder) SetBuildConfigEnv(env map[string]string)
- func (b *Builder) SetDescription(description string)
- func (b *Builder) SetEnv(env map[string]string)
- func (b *Builder) SetLifecycle(lifecycle Lifecycle)
- func (b *Builder) SetOrder(order dist.Order)
- func (b *Builder) SetOrderExtensions(order dist.Order)
- func (b *Builder) SetRunImage(runConfig builder.RunConfig)
- func (b *Builder) SetStack(stackConfig builder.StackConfig)
- func (b *Builder) SetValidateMixins(to bool)
- func (b *Builder) ShouldFlatten(module buildpack.BuildModule) bool
- func (b *Builder) Stack() StackMetadata
- func (b *Builder) UID() int
- type BuilderOption
- type CreatorMetadata
- type DetectionCalculator
- type DetectionOrderCalculator
- type ImageFetcher
- type ImageFetcherWrapper
- type Info
- type Inspectable
- type InspectableFetcher
- type Inspector
- type KnownBuilder
- type LabelInspector
- type LabelManager
- func (m *LabelManager) BuildpackLayers() (dist.ModuleLayers, error)
- func (m *LabelManager) Metadata() (Metadata, error)
- func (m *LabelManager) Mixins() ([]string, error)
- func (m *LabelManager) Order() (dist.Order, error)
- func (m *LabelManager) OrderExtensions() (dist.Order, error)
- func (m *LabelManager) StackID() (string, error)
- type LabelManagerFactory
- type LabelManagerProvider
- type Lifecycle
- type LifecycleAPI
- type LifecycleAPIs
- type LifecycleDescriptor
- type LifecycleInfo
- type LifecycleMetadata
- type Metadata
- type RunImageMetadata
- type RunImages
- type StackMetadata
- type Version
Constants ¶
const ( EnvUID = "CNB_USER_ID" EnvGID = "CNB_GROUP_ID" ModuleOnBuilderMessage = `%s %s already exists on builder and will be overwritten - existing diffID: %s - new diffID: %s` ModulePreviouslyDefinedMessage = `%s %s was previously defined with different contents and will be overwritten - previous diffID: %s - using diffID: %s` )
const ( DefaultLifecycleVersion = "0.19.6" DefaultBuildpackAPIVersion = "0.2" )
A snapshot of the latest tested lifecycle version values
const ( OrderLabel = "io.buildpacks.buildpack.order" OrderExtensionsLabel = "io.buildpacks.buildpack.order-extensions" )
Variables ¶
var KnownBuilders = []KnownBuilder{ { Vendor: "Google", Image: "gcr.io/buildpacks/builder:v1", DefaultDescription: "GCP Builder for all runtimes", Suggested: true, Trusted: true, }, { Vendor: "Heroku", Image: "heroku/builder:24", DefaultDescription: "Ubuntu 24.04 AMD64+ARM64 base image with buildpacks for Go, Java, Node.js, PHP, Python, Ruby & Scala.", Suggested: true, Trusted: true, }, { Vendor: "Heroku", Image: "heroku/builder:22", DefaultDescription: "Ubuntu 22.04 AMD64 base image with buildpacks for Go, Java, Node.js, PHP, Python, Ruby & Scala.", Suggested: false, Trusted: true, }, { Vendor: "Heroku", Image: "heroku/builder:20", DefaultDescription: "Ubuntu 20.04 AMD64 base image with buildpacks for Go, Java, Node.js, PHP, Python, Ruby & Scala.", Suggested: false, Trusted: true, }, { Vendor: "Paketo Buildpacks", Image: "paketobuildpacks/builder-jammy-base", DefaultDescription: "Small base image with buildpacks for Java, Node.js, Golang, .NET Core, Python & Ruby", Suggested: true, Trusted: true, }, { Vendor: "Paketo Buildpacks", Image: "paketobuildpacks/builder-jammy-full", DefaultDescription: "Larger base image with buildpacks for Java, Node.js, Golang, .NET Core, Python, Ruby, & PHP", Suggested: true, Trusted: true, }, { Vendor: "Paketo Buildpacks", Image: "paketobuildpacks/builder-jammy-tiny", DefaultDescription: "Tiny base image (jammy build image, distroless run image) with buildpacks for Golang & Java", Suggested: true, Trusted: true, }, { Vendor: "Paketo Buildpacks", Image: "paketobuildpacks/builder-jammy-buildpackless-static", DefaultDescription: "Static base image (jammy build image, distroless run image) suitable for static binaries like Go or Rust", Suggested: true, Trusted: true, }, }
Functions ¶
func SupportedLinuxArchitecture ¶ added in v0.34.0
SupportedLinuxArchitecture returns true for each binary architecture available at https://github.com/buildpacks/lifecycle/releases/
Types ¶
type APIVersions ¶ added in v0.13.0
type APIVersions struct { Deprecated APISet `toml:"deprecated" json:"deprecated" yaml:"deprecated"` Supported APISet `toml:"supported" json:"supported" yaml:"supported"` }
APIVersions describes the supported API versions
type Blob ¶
type Blob interface {
Open() (io.ReadCloser, error)
}
Blob is an interface to wrap opening blobs
type Builder ¶
type Builder struct { StackID string // contains filtered or unexported fields }
Builder represents a pack builder, used to build images
func (*Builder) AddBuildpack ¶
func (b *Builder) AddBuildpack(bp buildpack.BuildModule)
AddBuildpack adds a buildpack to the builder
func (*Builder) AddBuildpacks ¶ added in v0.30.0
func (b *Builder) AddBuildpacks(main buildpack.BuildModule, dependencies []buildpack.BuildModule)
func (*Builder) AddExtension ¶ added in v0.28.0
func (b *Builder) AddExtension(bp buildpack.BuildModule)
AddExtension adds an extension to the builder
func (*Builder) AllModules ¶ added in v0.30.0
func (b *Builder) AllModules(kind string) []buildpack.BuildModule
func (*Builder) BaseImageName ¶ added in v0.23.0
BaseImageName returns the name of the builder base image
func (*Builder) Buildpacks ¶
func (b *Builder) Buildpacks() []dist.ModuleInfo
Buildpacks returns the buildpack list
func (*Builder) CreatedBy ¶
func (b *Builder) CreatedBy() CreatorMetadata
CreatedBy returns metadata around the creation of the builder
func (*Builder) DefaultRunImage ¶ added in v0.30.0
func (b *Builder) DefaultRunImage() RunImageMetadata
DefaultRunImage returns the default run image metadata
func (*Builder) Description ¶
Description returns the builder description
func (*Builder) Extensions ¶ added in v0.28.0
func (b *Builder) Extensions() []dist.ModuleInfo
Extensions returns the extensions list
func (*Builder) FlattenedModules ¶ added in v0.30.0
func (b *Builder) FlattenedModules(kind string) [][]buildpack.BuildModule
func (*Builder) LifecycleDescriptor ¶
func (b *Builder) LifecycleDescriptor() LifecycleDescriptor
LifecycleDescriptor returns the LifecycleDescriptor
func (*Builder) OrderExtensions ¶ added in v0.28.0
OrderExtensions returns the order for extensions
func (*Builder) RunImages ¶ added in v0.30.0
func (b *Builder) RunImages() []RunImageMetadata
RunImages returns all run image metadata
func (*Builder) Save ¶
func (b *Builder) Save(logger logging.Logger, creatorMetadata CreatorMetadata) error
Save saves the builder
func (*Builder) SetBuildConfigEnv ¶ added in v0.32.0
SetBuildConfigEnv sets an environment variable to a value that will take action on platform environment variables basedon filename suffix
func (*Builder) SetDescription ¶
SetDescription sets the description of the builder
func (*Builder) SetLifecycle ¶
SetLifecycle sets the lifecycle of the builder
func (*Builder) SetOrderExtensions ¶ added in v0.28.0
SetOrderExtensions sets the order of the builder
func (*Builder) SetRunImage ¶ added in v0.30.0
SetRunImage sets the run image of the builder
func (*Builder) SetStack ¶
func (b *Builder) SetStack(stackConfig builder.StackConfig)
SetStack sets the stack of the builder
func (*Builder) SetValidateMixins ¶ added in v0.30.0
SetValidateMixins if true instructs the builder to validate mixins
func (*Builder) ShouldFlatten ¶ added in v0.30.0
func (b *Builder) ShouldFlatten(module buildpack.BuildModule) bool
type BuilderOption ¶ added in v0.30.0
type BuilderOption func(*options) error
func WithFlattened ¶ added in v0.33.0
func WithFlattened(modules buildpack.FlattenModuleInfos) BuilderOption
func WithLabels ¶ added in v0.33.0
func WithLabels(labels map[string]string) BuilderOption
func WithRunImage ¶ added in v0.34.0
func WithRunImage(name string) BuilderOption
type CreatorMetadata ¶
type DetectionCalculator ¶ added in v0.15.0
type DetectionCalculator interface {
Order(topOrder dist.Order, layers dist.ModuleLayers, depth int) (pubbldr.DetectionOrder, error)
}
type DetectionOrderCalculator ¶ added in v0.15.0
type DetectionOrderCalculator struct{}
func NewDetectionOrderCalculator ¶ added in v0.15.0
func NewDetectionOrderCalculator() *DetectionOrderCalculator
func (*DetectionOrderCalculator) Order ¶ added in v0.15.0
func (c *DetectionOrderCalculator) Order( order dist.Order, layers dist.ModuleLayers, maxDepth int, ) (pubbldr.DetectionOrder, error)
type ImageFetcher ¶ added in v0.15.0
type ImageFetcher interface { // Fetch fetches an image by resolving it both remotely and locally depending on provided parameters. // If daemon is true, it will look return a `local.Image`. Pull, applicable only when daemon is true, will // attempt to pull a remote image first. Fetch(ctx context.Context, name string, options image.FetchOptions) (imgutil.Image, error) // CheckReadAccess verifies if an image is accessible with read permissions // When FetchOptions.Daemon is true and the image doesn't exist in the daemon, // the behavior is dictated by the pull policy, which can have the following behavior // - PullNever: returns false // - PullAlways Or PullIfNotPresent: it will check read access for the remote image. // When FetchOptions.Daemon is false it will check read access for the remote image. CheckReadAccess(repo string, options image.FetchOptions) bool }
type ImageFetcherWrapper ¶ added in v0.15.0
type ImageFetcherWrapper struct {
// contains filtered or unexported fields
}
func NewImageFetcherWrapper ¶ added in v0.15.0
func NewImageFetcherWrapper(fetcher ImageFetcher) *ImageFetcherWrapper
func (*ImageFetcherWrapper) CheckReadAccessValidator ¶ added in v0.34.0
func (w *ImageFetcherWrapper) CheckReadAccessValidator(repo string, options image.FetchOptions) bool
func (*ImageFetcherWrapper) Fetch ¶ added in v0.15.0
func (w *ImageFetcherWrapper) Fetch( ctx context.Context, name string, options image.FetchOptions, ) (Inspectable, error)
type Info ¶ added in v0.15.0
type Info struct { Description string StackID string Mixins []string RunImages []pubbldr.RunImageConfig Buildpacks []dist.ModuleInfo Order pubbldr.DetectionOrder BuildpackLayers dist.ModuleLayers Lifecycle LifecycleDescriptor CreatedBy CreatorMetadata Extensions []dist.ModuleInfo OrderExtensions pubbldr.DetectionOrder }
type Inspectable ¶ added in v0.15.0
type InspectableFetcher ¶ added in v0.15.0
type InspectableFetcher interface {
Fetch(ctx context.Context, name string, options image.FetchOptions) (Inspectable, error)
}
type Inspector ¶ added in v0.15.0
type Inspector struct {
// contains filtered or unexported fields
}
func NewInspector ¶ added in v0.15.0
func NewInspector(fetcher InspectableFetcher, factory LabelManagerFactory, calculator DetectionCalculator) *Inspector
type KnownBuilder ¶ added in v0.33.2
type LabelInspector ¶ added in v0.15.0
type LabelManager ¶ added in v0.15.0
type LabelManager struct {
// contains filtered or unexported fields
}
func NewLabelManager ¶ added in v0.15.0
func NewLabelManager(inspectable Inspectable) *LabelManager
func (*LabelManager) BuildpackLayers ¶ added in v0.15.0
func (m *LabelManager) BuildpackLayers() (dist.ModuleLayers, error)
func (*LabelManager) Metadata ¶ added in v0.15.0
func (m *LabelManager) Metadata() (Metadata, error)
func (*LabelManager) Mixins ¶ added in v0.15.0
func (m *LabelManager) Mixins() ([]string, error)
func (*LabelManager) OrderExtensions ¶ added in v0.29.0
func (m *LabelManager) OrderExtensions() (dist.Order, error)
func (*LabelManager) StackID ¶ added in v0.15.0
func (m *LabelManager) StackID() (string, error)
type LabelManagerFactory ¶ added in v0.15.0
type LabelManagerFactory interface {
BuilderLabelManager(inspectable Inspectable) LabelInspector
}
type LabelManagerProvider ¶ added in v0.15.0
type LabelManagerProvider struct{}
func NewLabelManagerProvider ¶ added in v0.15.0
func NewLabelManagerProvider() *LabelManagerProvider
func (*LabelManagerProvider) BuilderLabelManager ¶ added in v0.15.0
func (p *LabelManagerProvider) BuilderLabelManager(inspectable Inspectable) LabelInspector
type Lifecycle ¶
type Lifecycle interface { Blob Descriptor() LifecycleDescriptor }
Lifecycle is an implementation of the CNB Lifecycle spec
func NewLifecycle ¶
NewLifecycle creates a Lifecycle from a Blob
type LifecycleAPI ¶
type LifecycleAPI struct { BuildpackVersion *api.Version `toml:"buildpack" json:"buildpack"` PlatformVersion *api.Version `toml:"platform" json:"platform"` }
LifecycleAPI describes which API versions the lifecycle satisfies
type LifecycleAPIs ¶ added in v0.13.0
type LifecycleAPIs struct { Buildpack APIVersions `toml:"buildpack" json:"buildpack"` Platform APIVersions `toml:"platform" json:"platform"` }
LifecycleAPIs describes the supported API versions per specification
type LifecycleDescriptor ¶
type LifecycleDescriptor struct { Info LifecycleInfo `toml:"lifecycle"` // Deprecated: Use `LifecycleAPIs` instead API LifecycleAPI `toml:"api"` APIs LifecycleAPIs `toml:"apis"` }
LifecycleDescriptor contains information described in the lifecycle.toml
func CompatDescriptor ¶ added in v0.13.0
func CompatDescriptor(descriptor LifecycleDescriptor) LifecycleDescriptor
CompatDescriptor provides compatibility by mapping new fields to old and vice-versa
func ParseDescriptor ¶ added in v0.13.0
func ParseDescriptor(contents string) (LifecycleDescriptor, error)
ParseDescriptor parses LifecycleDescriptor from toml formatted string.
type LifecycleInfo ¶
type LifecycleInfo struct {
Version *Version `toml:"version" json:"version" yaml:"version"`
}
LifecycleInfo contains information about the lifecycle
type LifecycleMetadata ¶
type LifecycleMetadata struct { LifecycleInfo // Deprecated: use APIs instead API LifecycleAPI `json:"api"` APIs LifecycleAPIs `json:"apis"` }
type Metadata ¶
type Metadata struct { Description string `json:"description"` Buildpacks []dist.ModuleInfo `json:"buildpacks"` Extensions []dist.ModuleInfo `json:"extensions"` Stack StackMetadata `json:"stack"` Lifecycle LifecycleMetadata `json:"lifecycle"` CreatedBy CreatorMetadata `json:"createdBy"` RunImages []RunImageMetadata `json:"images"` }
type RunImageMetadata ¶
type RunImages ¶ added in v0.30.0
type RunImages struct {
Images []RunImageMetadata `json:"images" toml:"images"`
}
type StackMetadata ¶
type StackMetadata struct {
RunImage RunImageMetadata `json:"runImage" toml:"run-image"`
}
type Version ¶
Version is an extension to semver.Version to make it marshalable.
func VersionMustParse ¶
VersionMustParse parses a string into a Version
func (*Version) MarshalText ¶
MarshalText makes Version satisfy the encoding.TextMarshaler interface.
func (*Version) UnmarshalText ¶
UnmarshalText makes Version satisfy the encoding.TextUnmarshaler interface.