Documentation ¶
Index ¶
- Constants
- Variables
- func DecodeLabel(image imgutil.Image, label string, v interface{}) error
- func MetadataFilePath(layersDir string) string
- func SetupCredHelpers(dockerPath string, refs ...string) error
- func TruncateSha(sha string) string
- func WriteTOML(path string, data interface{}) error
- type AnalyzedMetadata
- type Analyzer
- type BOMEntry
- type BuildEnv
- type BuildMetadata
- type BuildPlan
- type BuildPlanEntry
- type Builder
- type Buildpack
- type BuildpackGroup
- type BuildpackLayerMetadata
- type BuildpackLayerMetadataFile
- type BuildpackLayersMetadata
- type BuildpackOrder
- type Cache
- type CacheMetadata
- type DetectConfig
- type Env
- type Exporter
- type GitMetadata
- type ImageIdentifier
- type LaunchTOML
- type Launcher
- type LauncherConfig
- type LauncherMetadata
- type LayerMetadata
- type LayersMetadata
- type LayersMetadataCompat
- type Logger
- type MultiError
- type Process
- type Provide
- type Rebaser
- type Require
- type Restorer
- type RunImageMetadata
- type Slice
- type SliceLayer
- type SourceMetadata
- type StackMetadata
- type StackRunImageMetadata
Constants ¶
View Source
const ( CodeDetectPass = 0 CodeDetectFail = 100 )
View Source
const ( BuildMetadataLabel = "io.buildpacks.build.metadata" LayerMetadataLabel = "io.buildpacks.lifecycle.metadata" StackIDLabel = "io.buildpacks.stack.id" )
Variables ¶
View Source
var ErrFail = errors.New("no buildpacks participating")
View Source
var POSIXBuildEnv = map[string][]string{
"bin": {
"PATH",
},
"lib": {
"LD_LIBRARY_PATH",
"LIBRARY_PATH",
},
"include": {
"CPATH",
},
"pkgconfig": {
"PKG_CONFIG_PATH",
},
}
View Source
var POSIXLaunchEnv = map[string][]string{
"bin": {"PATH"},
"lib": {"LD_LIBRARY_PATH"},
}
Functions ¶
func MetadataFilePath ¶
func SetupCredHelpers ¶
func TruncateSha ¶
Types ¶
type AnalyzedMetadata ¶
type AnalyzedMetadata struct { Image *ImageIdentifier `toml:"image"` Metadata LayersMetadata `toml:"metadata"` }
type Analyzer ¶
type BuildMetadata ¶
type BuildMetadata struct { Processes []Process `toml:"processes" json:"processes"` Buildpacks []Buildpack `toml:"buildpacks" json:"buildpacks"` BOM []BOMEntry `toml:"bom" json:"bom"` Launcher LauncherMetadata `toml:"-" json:"launcher"` Slices []Slice `toml:"slices" json:"-"` }
type BuildPlan ¶
type BuildPlan struct {
Entries []BuildPlanEntry `toml:"entries"`
}
type BuildPlanEntry ¶
type Builder ¶
type Builder struct { AppDir string LayersDir string PlatformDir string BuildpacksDir string Env BuildEnv Group BuildpackGroup Plan BuildPlan Out, Err *log.Logger }
func (*Builder) Build ¶
func (b *Builder) Build() (*BuildMetadata, error)
type Buildpack ¶
type BuildpackGroup ¶
type BuildpackGroup struct {
Group []Buildpack `toml:"group"`
}
func ReadGroup ¶
func ReadGroup(path string) (BuildpackGroup, error)
func (BuildpackGroup) Detect ¶
func (bg BuildpackGroup) Detect(c *DetectConfig) (BuildpackGroup, BuildPlan, error)
type BuildpackLayerMetadata ¶
type BuildpackLayerMetadata struct { LayerMetadata BuildpackLayerMetadataFile }
type BuildpackLayersMetadata ¶
type BuildpackLayersMetadata struct { ID string `json:"key" toml:"key"` Version string `json:"version" toml:"version"` Layers map[string]BuildpackLayerMetadata `json:"layers" toml:"layers"` }
type BuildpackOrder ¶
type BuildpackOrder []BuildpackGroup
func ReadOrder ¶
func ReadOrder(path string) (BuildpackOrder, error)
func (BuildpackOrder) Detect ¶
func (bo BuildpackOrder) Detect(c *DetectConfig) (BuildpackGroup, BuildPlan, error)
type Cache ¶
type Cache interface { Name() string SetMetadata(metadata CacheMetadata) error RetrieveMetadata() (CacheMetadata, error) AddLayerFile(sha string, tarPath string) error ReuseLayer(sha string) error RetrieveLayer(sha string) (io.ReadCloser, error) Commit() error }
type CacheMetadata ¶
type CacheMetadata struct {
Buildpacks []BuildpackLayersMetadata `json:"buildpacks"`
}
func (*CacheMetadata) MetadataForBuildpack ¶
func (cm *CacheMetadata) MetadataForBuildpack(id string) BuildpackLayersMetadata
type DetectConfig ¶
type Env ¶
type Env struct { LookupEnv func(key string) (string, bool) Getenv func(key string) string Setenv func(key, value string) error Unsetenv func(key string) error Environ func() []string Map map[string][]string }
func (*Env) AddRootDir ¶
type Exporter ¶
type Exporter struct { Buildpacks []Buildpack ArtifactsDir string Logger Logger UID, GID int // contains filtered or unexported fields }
func (*Exporter) Export ¶
func (e *Exporter) Export( layersDir, appDir string, workingImage imgutil.Image, runImageRef string, origMetadata LayersMetadata, additionalNames []string, launcherConfig LauncherConfig, stack StackMetadata, ) error
type GitMetadata ¶
type ImageIdentifier ¶
type ImageIdentifier struct {
Reference string `toml:"reference"`
}
FIXME: fix key names to be accurate in the daemon case
type LaunchTOML ¶
type Launcher ¶
type LauncherConfig ¶
type LauncherConfig struct { Path string Metadata LauncherMetadata }
type LauncherMetadata ¶
type LauncherMetadata struct { Version string `json:"version"` Source SourceMetadata `json:"source"` }
type LayerMetadata ¶
type LayerMetadata struct {
SHA string `json:"sha" toml:"sha"`
}
type LayersMetadata ¶
type LayersMetadata struct { App []LayerMetadata `json:"app" toml:"app"` Config LayerMetadata `json:"config" toml:"config"` Launcher LayerMetadata `json:"launcher" toml:"launcher"` Buildpacks []BuildpackLayersMetadata `json:"buildpacks" toml:"buildpacks"` RunImage RunImageMetadata `json:"runImage" toml:"run-image"` Stack StackMetadata `json:"stack" toml:"stack"` }
NOTE: This struct MUST be kept in sync with `LayersMetadataCompat`
func (*LayersMetadata) MetadataForBuildpack ¶
func (m *LayersMetadata) MetadataForBuildpack(id string) BuildpackLayersMetadata
type LayersMetadataCompat ¶
type LayersMetadataCompat struct { App interface{} `json:"app" toml:"app"` Config LayerMetadata `json:"config" toml:"config"` Launcher LayerMetadata `json:"launcher" toml:"launcher"` Buildpacks []BuildpackLayersMetadata `json:"buildpacks" toml:"buildpacks"` RunImage RunImageMetadata `json:"runImage" toml:"run-image"` Stack StackMetadata `json:"stack" toml:"stack"` }
NOTE: This struct MUST be kept in sync with `LayersMetadata`. It exists for situations where the `App` field type cannot be guaranteed, yet the original struct data must be maintained.
type MultiError ¶
type MultiError struct {
Errors []error
}
func (*MultiError) Error ¶
func (me *MultiError) Error() string
type RunImageMetadata ¶
type SliceLayer ¶
type SourceMetadata ¶
type SourceMetadata struct {
Git GitMetadata `json:"git"`
}
type StackMetadata ¶
type StackMetadata struct {
RunImage StackRunImageMetadata `json:"runImage" toml:"run-image"`
}
func (*StackMetadata) BestRunImageMirror ¶
func (sm *StackMetadata) BestRunImageMirror(registry string) (string, error)
type StackRunImageMetadata ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.