dockerfile

package
v0.3.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpAll

func DumpAll(result []*parser.Node) string

func DumpNode

func DumpNode(node *parser.Node) string

func EnsureDockerfileHasFinalStageName

func EnsureDockerfileHasFinalStageName(dockerfileContent string, defaultLastStageName string) (string, string, error)

func RemoveSyntaxVersion

func RemoveSyntaxVersion(dockerfileContent string) string

func ReplaceInDockerfile

func ReplaceInDockerfile(dockerfileContent string, node *parser.Node) string

Types

type BaseStage

type BaseStage struct {
	Image  string
	Target string

	Envs         []KeyValue
	Args         []KeyValue
	Instructions []*parser.Node
}

type Dockerfile

type Dockerfile struct {
	Raw string

	Directives []*parser.Directive
	Preamble   *Preamble

	Stages         []*Stage
	StagesByTarget map[string]*Stage
}

func Parse

func Parse(dockerfileContent string) (*Dockerfile, error)

func (*Dockerfile) Dump

func (d *Dockerfile) Dump() string

func (*Dockerfile) FindBaseImage

func (d *Dockerfile) FindBaseImage(buildArgs map[string]string, target string) string

func (*Dockerfile) FindUserStatement

func (d *Dockerfile) FindUserStatement(buildArgs map[string]string, baseImageEnv map[string]string, target string) string

type KeyValue

type KeyValue struct {
	Key   string
	Value string
	Line  int
}

type Preamble

type Preamble struct {
	BaseStage
}

type Stage

type Stage struct {
	BaseStage
	Users []KeyValue
}

Jump to

Keyboard shortcuts

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