stack

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseImageName

func ParseImageName(imageName string) (reference.Named, error)

ParseImageName parses an image name to a reference.

func ParseNormalizedImageName

func ParseNormalizedImageName(imageName string) (reference.Named, error)

ParseNormalizedImageName parses a normalized image name to a reference.

Types

type ImageLayer

type ImageLayer struct {
	// Reference is the name/tag/etc of this image.
	Reference reference.Named
	// Dockerfile is the dockerfile source for this image.
	Dockerfile *dfparser.Node
	// Path is the path to the dockerfile directory for this image layer.
	Path string
	// OriginalDockerfile is the original source for the dockerfile.
	OriginalDockerfile string
}

ImageLayer is a layer in a stack.

func (*ImageLayer) ParseDockerfile

func (l *ImageLayer) ParseDockerfile(source string) error

ParseDockerfile applies a Dockerfile source to a layer.

func (*ImageLayer) RewriteFrom

func (l *ImageLayer) RewriteFrom(img reference.Reference)

RewriteFrom rewrites the FROM definition in the dockerfile.

func (*ImageLayer) ToDockerfile

func (l *ImageLayer) ToDockerfile() string

ToDockerfile produces a Dockerfile equivilent to the original source.

type ImageStack

type ImageStack struct {
	// The final reference of the last layer.
	Reference reference.Named
	// Layers, from top to bottom.
	Layers []*ImageLayer
}

ImageStack represents an image as a stack of layers.

func ImageStackFromPath

func ImageStackFromPath(buildPath string, dockerfilePath string, targetTag string, resolver LibraryResolver, rebaseArch arch.KnownArch) (*ImageStack, error)

ImageStackFromDockerfile attempts to determine the full stack of the docker image.

func (*ImageStack) RebaseOnArch

func (s *ImageStack) RebaseOnArch(target arch.KnownArch) error

RebaseOnArch attempts to rebase the Stack on a compatible image for the target arch.

func (*ImageStack) String

func (s *ImageStack) String() string

String represents the stack as a string.

func (*ImageStack) ToDockerfile

func (s *ImageStack) ToDockerfile() string

ToDockerfile produces a series of dockerfiles representing the stack.

type LibraryResolver

type LibraryResolver interface {
	// GetLibrarySource clones the source for the Dockerfile
	GetLibrarySource(ref reference.NamedTagged) (string, error)
}

LibraryResolver resolves dockerfile sources for library images.

Jump to

Keyboard shortcuts

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