dockerfile

package
v0.5.28 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 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) BuildContextFiles added in v0.5.20

func (d *Dockerfile) BuildContextFiles() (files []string)

BuildContextFiles traverses a build stage and returns a list of any file path that would affect the build context

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