dockerfile

package
v0.8.12 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2025 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureFinalStageName added in v0.8.8

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

func FormatNode added in v0.8.8

func FormatNode(node *parser.Node) string

func FormatNodes added in v0.8.8

func FormatNodes(nodes []*parser.Node) string

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         []instructions.KeyValuePair
	Args         []instructions.KeyValuePairOptional
	Instructions []*parser.Node
}

type Dockerfile

type Dockerfile struct {
	Raw string

	Directives []*parser.Directive
	Preamble   *Preamble
	Syntax     string // https://docs.docker.com/build/concepts/dockerfile/#dockerfile-syntax

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

func Parse

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

func (*Dockerfile) BuildContextFiles

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

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, baseImageEnv map[string]string, target string) string

type Preamble

type Preamble struct {
	BaseStage
}

type Stage

type Stage struct {
	BaseStage
	Users []instructions.KeyValuePair
}

Jump to

Keyboard shortcuts

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