stack

package
v0.0.0-...-fd3e7b7 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BOM

type BOM struct{}

func NewBOM

func NewBOM() BOM

func (BOM) Attach

func (b BOM) Attach(imageTag string, files []string) error

Attach takes in the image tag of an image on the local Docker daemon, and files to add to that image. It expects a files to have `syft.json` in the name to denote a Syft-type BOM file, and it denotes all other given files as `bom.cdx.json` to denote CycloneDX. Files are added to `/cnb/sbom/`, and are turned into a layer and added to the image. This function also adds a layer to the image under `io.buildpacks.base.sbom`, with the value set to the diffID of the newly added layer.

func (BOM) CreateLayer

func (b BOM) CreateLayer(mappings []InputOutputMapping) (v1.Layer, error)

func (BOM) Generate

func (b BOM) Generate(imageTag string) ([]string, error)

Generate takes in an existent image tag, and generates two Bill of Materials using the anchore/syft library, and then returns the filepaths to both created files. The function generates two files. One in the Syft JSON format, and the other in CycloneDX 1.3 JSON.

type BOMGenerator

type BOMGenerator interface {
	Generate(imageTag string) (outputPaths []string, err error)
	Attach(cnbImageTag string, files []string) (err error)
}

type Creator

type Creator struct {
	PackageFinder   PackageFinder
	MixinsGenerator MixinsGenerator
	ImageClient     ImageClient
	BOMGenerator    BOMGenerator
	AttachBOM       bool
}

func (Creator) CreateStack deprecated

func (c Creator) CreateStack(stackable Stack, buildBaseTag, runBaseTag string, publish bool) error

Deprecated: use Execute instead

func (Creator) Execute

func (c Creator) Execute(def Definition) error

type Definition

type Definition struct {
	BuildBase Image
	BuildCNB  Image
	RunBase   Image
	RunCNB    Image
}

func NewBaseStack

func NewBaseStack(buildTag, runTag, stackDir string, publish bool) (Definition, error)

func NewFullStack

func NewFullStack(buildTag, runTag, stackDir string, publish bool) (Definition, error)

func NewTinyStack

func NewTinyStack(buildTag, runTag, stackDir string, publish bool) (Definition, error)

type Image

type Image struct {
	UseBuildKit bool
	Publish     bool
	Tag         string
	Dockerfile  string
	Description string
	Args        []string
	Secrets     map[string]string
}

type ImageClient

type ImageClient interface {
	Build(tag, dockerfilePath string, withBuildKit bool, secrets map[string]string, buildArgs ...string) error
	Push(tag string) (string, error)
	Pull(tag string, keychain authn.Keychain) (v1.Image, error)
	SetLabel(tag, key, value string) error
}

type InputOutputMapping

type InputOutputMapping struct {
	FileName string
	File     io.ReadCloser
	DstPath  string
	Size     int64
}

type Mixins

type Mixins struct{}

func (Mixins) GetMixins

func (m Mixins) GetMixins(buildPackages, runPackages []string) ([]string, []string)

type MixinsGenerator

type MixinsGenerator interface {
	GetMixins(buildPackages, runPackages []string) (buildMixins []string, runMixins []string)
}

type PackageFinder

type PackageFinder interface {
	GetBuildPackagesList(image string) (list []string, err error)
	GetRunPackagesList(image string) (list []string, err error)
	GetBuildPackageMetadata(image string) (metadata string, err error)
	GetRunPackageMetadata(image string) (metadata string, err error)
}

type Stack

type Stack interface {
	GetName() string
	WithBuildKit() bool
	GetSecretArgs() map[string]string
	GetBaseBuildArgs() []string
	GetBaseRunArgs() []string
	GetCNBBuildArgs() []string
	GetCNBRunArgs() []string
	GetBaseBuildDockerfilePath() string
	GetBaseRunDockerfilePath() string
	GetCNBBuildDockerfilePath() string
	GetCNBRunDockerfilePath() string
	GetBuildDescription() string
	GetRunDescription() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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