dazzle

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeImages

func MergeImages(env *Environment, dest, base string, addons ...string) error

MergeImages merges a set of Docker images while keeping the layer hashes

Types

type BuildConfig

type BuildConfig struct {
	Env *Environment

	// BuildImageRepo is the name/repo of the individual build layers. When UseRegistry is true
	// this repo should be something that can be pushed to a registry.
	BuildImageRepo string
}

BuildConfig configures a dazzle build

type BuildResult added in v0.0.2

type BuildResult struct {
	BaseImage    LayerBuildResult
	Layers       []LayerBuildResult
	PrologueTest []*test.Results
}

BuildResult describes the information produced during a build

func Build

func Build(cfg BuildConfig, loc, dockerfile, dst string) (*BuildResult, error)

Build builds a Dockerfile with independent layers

type Environment

type Environment struct {
	BaseOut   io.Writer
	Client    *docker.Client
	DockerCfg *configfile.ConfigFile

	PrettyLayerNames map[string]string

	Formatter *fancylog.Formatter
	Context   context.Context
	Workdir   string
}

Environment describes the environment in which an image merge is to happen

func NewEnvironment

func NewEnvironment() (*Environment, error)

NewEnvironment creates a new default environment

func (*Environment) Out

func (env *Environment) Out() io.WriteCloser

Out produces the output channel for log output

type LayerBuildResult added in v0.0.2

type LayerBuildResult struct {
	Ref        string
	Pulled     bool
	LayerName  string
	HasTest    bool
	TestResult *test.Results
	Size       int64
}

LayerBuildResult is the result of an individual layer build

type ParsedDockerfile

type ParsedDockerfile struct {
	AST   *parser.Node
	Lines []string
}

ParsedDockerfile contains the result of a Dockerfile parse

func ParseDockerfile

func ParseDockerfile(fn string) (*ParsedDockerfile, error)

ParseDockerfile parses a Dockerfile

func (*ParsedDockerfile) ExtractEnvs

func (df *ParsedDockerfile) ExtractEnvs(out io.Writer, fn string) error

ExtractEnvs creates a new Dockerfile which only contains the ENV statements of the parent

func (*ParsedDockerfile) ExtractFrom

func (df *ParsedDockerfile) ExtractFrom(out io.Writer, sp SplitPoint, baseImage string) error

ExtractFrom extracts a new Dockerfile at the given splitpoint

func (*ParsedDockerfile) ExtractTo added in v0.0.3

func (df *ParsedDockerfile) ExtractTo(fn string, sp SplitPoint, baseImage string) error

ExtractTo extracts a new Dockerfile at the given splitpoint

func (*ParsedDockerfile) SplitPoints

func (df *ParsedDockerfile) SplitPoints() ([]SplitPoint, error)

SplitPoints computes the splitpoints along the dazzle/layer labels

func (*ParsedDockerfile) Validate

func (df *ParsedDockerfile) Validate() error

Validate ensures that the Dockerfile is suitable for use with dazzle

type SplitPoint

type SplitPoint struct {
	StartLine int
	EndLine   int
	Name      string
	Test      string
}

SplitPoint is a location within a Dockerfile where that file gets split

Jump to

Keyboard shortcuts

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