Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseImageName ¶
ParseImageName parses an 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.