builder

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvUID = "CNB_USER_ID"
	EnvGID = "CNB_GROUP_ID"

	BuildpackOnBuilderMessage = `buildpack %s already exists on builder and will be overwritten
  - existing diffID: %s
  - new diffID: %s`

	BuildpackPreviouslyDefinedMessage = `` /* 128-byte string literal not displayed */

)
View Source
const (
	DefaultLifecycleVersion    = "0.13.3"
	DefaultBuildpackAPIVersion = "0.2"
)

A snapshot of the latest tested lifecycle version values

View Source
const (
	OrderLabel = "io.buildpacks.buildpack.order"
)

Variables

View Source
var SuggestedBuilders = []SuggestedBuilder{
	{
		Vendor:             "Google",
		Image:              "gcr.io/buildpacks/builder:v1",
		DefaultDescription: "GCP Builder for all runtimes",
	},
	{
		Vendor:             "Heroku",
		Image:              "heroku/buildpacks:20",
		DefaultDescription: "heroku-20 base image with buildpacks for Ruby, Java, Node.js, Python, Golang, & PHP",
	},
	{
		Vendor:             "Paketo Buildpacks",
		Image:              "paketobuildpacks/builder:base",
		DefaultDescription: "Small base image with buildpacks for Java, Node.js, Golang, & .NET Core",
	},
	{
		Vendor:             "Paketo Buildpacks",
		Image:              "paketobuildpacks/builder:full",
		DefaultDescription: "Larger base image with buildpacks for Java, Node.js, Golang, .NET Core, & PHP",
	},
	{
		Vendor:             "Paketo Buildpacks",
		Image:              "paketobuildpacks/builder:tiny",
		DefaultDescription: "Tiny base image (bionic build image, distroless run image) with buildpacks for Golang",
	},
}

Functions

This section is empty.

Types

type APISet added in v0.13.0

type APISet []*api.Version

func (APISet) AsStrings added in v0.13.0

func (a APISet) AsStrings() []string

func (APISet) Earliest added in v0.13.0

func (a APISet) Earliest() *api.Version

func (APISet) Latest added in v0.13.0

func (a APISet) Latest() *api.Version

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 FromImage

func FromImage(img imgutil.Image) (*Builder, error)

FromImage constructs a builder from a builder image

func New

func New(baseImage imgutil.Image, name string) (*Builder, error)

New constructs a new builder from a base image

func (*Builder) AddBuildpack

func (b *Builder) AddBuildpack(bp buildpack.Buildpack)

AddBuildpack adds a buildpack to the builder

func (*Builder) BaseImageName added in v0.23.0

func (b *Builder) BaseImageName() string

BaseImageName returns the name of the builder base image

func (*Builder) Buildpacks

func (b *Builder) Buildpacks() []dist.BuildpackInfo

Buildpacks returns the buildpack list

func (*Builder) CreatedBy

func (b *Builder) CreatedBy() CreatorMetadata

CreatedBy returns metadata around the creation of the builder

func (*Builder) Description

func (b *Builder) Description() string

Description returns the builder description

func (*Builder) GID

func (b *Builder) GID() int

GID returns the GID of the builder

func (*Builder) Image

func (b *Builder) Image() imgutil.Image

Image returns the base image

func (*Builder) LifecycleDescriptor

func (b *Builder) LifecycleDescriptor() LifecycleDescriptor

LifecycleDescriptor returns the LifecycleDescriptor

func (*Builder) Mixins

func (b *Builder) Mixins() []string

Mixins returns the mixins of the builder

func (*Builder) Name

func (b *Builder) Name() string

Name returns the name of the builder

func (*Builder) Order

func (b *Builder) Order() dist.Order

Order returns the order

func (*Builder) Save

func (b *Builder) Save(logger logging.Logger, creatorMetadata CreatorMetadata) error

Save saves the builder

func (*Builder) SetDescription

func (b *Builder) SetDescription(description string)

SetDescription sets the description of the builder

func (*Builder) SetEnv

func (b *Builder) SetEnv(env map[string]string)

SetEnv sets an environment variable to a value

func (*Builder) SetLifecycle

func (b *Builder) SetLifecycle(lifecycle Lifecycle)

SetLifecycle sets the lifecycle of the builder

func (*Builder) SetOrder

func (b *Builder) SetOrder(order dist.Order)

SetOrder sets the order of the builder

func (*Builder) SetStack

func (b *Builder) SetStack(stackConfig builder.StackConfig)

SetStack sets the stack of the builder

func (*Builder) Stack

func (b *Builder) Stack() StackMetadata

Stack returns the stack metadata

func (*Builder) UID

func (b *Builder) UID() int

UID returns the UID of the builder

type CreatorMetadata

type CreatorMetadata struct {
	Name    string `json:"name" yaml:"name"`
	Version string `json:"version" yaml:"version"`
}

type DetectionCalculator added in v0.15.0

type DetectionCalculator interface {
	Order(topOrder dist.Order, layers dist.BuildpackLayers, 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.BuildpackLayers,
	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)
}

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) 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
	RunImage        string
	RunImageMirrors []string
	Buildpacks      []dist.BuildpackInfo
	Order           pubbldr.DetectionOrder
	BuildpackLayers dist.BuildpackLayers
	Lifecycle       LifecycleDescriptor
	CreatedBy       CreatorMetadata
}

type Inspectable added in v0.15.0

type Inspectable interface {
	Label(name string) (string, error)
}

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

func (*Inspector) Inspect added in v0.15.0

func (i *Inspector) Inspect(name string, daemon bool, orderDetectionDepth int) (Info, error)

type LabelInspector added in v0.15.0

type LabelInspector interface {
	Metadata() (Metadata, error)
	StackID() (string, error)
	Mixins() ([]string, error)
	Order() (dist.Order, error)
	BuildpackLayers() (dist.BuildpackLayers, error)
}

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.BuildpackLayers, 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) Order added in v0.15.0

func (m *LabelManager) Order() (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

func NewLifecycle(blob Blob) (Lifecycle, error)

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.BuildpackInfo `json:"buildpacks"`
	Stack       StackMetadata        `json:"stack"`
	Lifecycle   LifecycleMetadata    `json:"lifecycle"`
	CreatedBy   CreatorMetadata      `json:"createdBy"`
}

type RunImageMetadata

type RunImageMetadata struct {
	Image   string   `json:"image" toml:"image"`
	Mirrors []string `json:"mirrors" toml:"mirrors"`
}

type StackMetadata

type StackMetadata struct {
	RunImage RunImageMetadata `json:"runImage" toml:"run-image"`
}

type SuggestedBuilder added in v0.22.0

type SuggestedBuilder struct {
	Vendor             string
	Image              string
	DefaultDescription string
}

type Version

type Version struct {
	semver.Version
}

Version is an extension to semver.Version to make it marshalable.

func VersionMustParse

func VersionMustParse(v string) *Version

VersionMustParse parses a string into a Version

func (*Version) Equal added in v0.10.0

func (v *Version) Equal(other *Version) bool

Equal compares two Versions

func (*Version) MarshalText

func (v *Version) MarshalText() ([]byte, error)

MarshalText makes Version satisfy the encoding.TextMarshaler interface.

func (*Version) String

func (v *Version) String() string

String returns the string value of the Version

func (*Version) UnmarshalText

func (v *Version) UnmarshalText(text []byte) error

UnmarshalText makes Version satisfy the encoding.TextUnmarshaler interface.

Directories

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

Jump to

Keyboard shortcuts

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