docker

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package docker implements a compiler for turning Blubber configuration into a valid single- or multi-stage Dockerfile.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(cfg *config.Config, variant string) (*bytes.Buffer, error)

Compile takes a parsed config.Config and a configured variant name and returns the bytes of a resulting Dockerfile. In the case where artifacts are defined or the shorthand "copies" configured is set, a multi-stage Dockerfile will be returned.

Types

type Copy added in v0.2.0

type Copy struct {
	// contains filtered or unexported fields
}

Copy compiles into a COPY instruction.

func (Copy) Arguments added in v0.2.0

func (di Copy) Arguments() []string

func (Copy) Compile added in v0.2.0

func (dc Copy) Compile() string

Compile compiles COPY instructions.

type CopyFrom added in v0.2.0

type CopyFrom struct {
	// contains filtered or unexported fields
}

CopyFrom compiles into a COPY --from instruction.

func (CopyFrom) Arguments added in v0.2.0

func (di CopyFrom) Arguments() []string

func (CopyFrom) Compile added in v0.2.0

func (dcf CopyFrom) Compile() string

Compile compiles COPY --from instructions.

type Env added in v0.2.0

type Env struct {
	// contains filtered or unexported fields
}

Env compiles into a ENV instruction.

func (Env) Arguments added in v0.2.0

func (di Env) Arguments() []string

func (Env) Compile added in v0.2.0

func (de Env) Compile() string

Compile compiles ENV instructions.

type Instruction added in v0.2.0

type Instruction interface {
	Compile() string
	Arguments() []string
}

Instruction defines an interface for instruction compilation.

func NewInstruction added in v0.2.0

func NewInstruction(instruction build.Instruction) (Instruction, error)

NewInstruction takes a general internal build.Instruction and returns a corresponding compilable Docker specific instruction. The given internal instruction is partially compiled at this point by calling Compile() which applies its own logic for escaping arguments, etc.

type Label added in v0.2.0

type Label struct {
	// contains filtered or unexported fields
}

Label compiles into a LABEL instruction.

func (Label) Arguments added in v0.2.0

func (di Label) Arguments() []string

func (Label) Compile added in v0.2.0

func (dl Label) Compile() string

Compile returns multiple key="value" arguments as a single LABEL instruction.

type Run added in v0.2.0

type Run struct {
	// contains filtered or unexported fields
}

Run compiles into a RUN instruction.

func (Run) Arguments added in v0.2.0

func (di Run) Arguments() []string

func (Run) Compile added in v0.2.0

func (dr Run) Compile() string

Compile compiles RUN instructions.

type Volume added in v0.2.0

type Volume struct {
	// contains filtered or unexported fields
}

Volume compiles into a VOLUME instruction.

func (Volume) Arguments added in v0.2.0

func (di Volume) Arguments() []string

func (Volume) Compile added in v0.2.0

func (dv Volume) Compile() string

Compile compiles VOLUME instructions.

Jump to

Keyboard shortcuts

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