extract

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandStartLine

func CommandStartLine(location []dfparser.Range) int

func InitialShellNameForStage

func InitialShellNameForStage(
	stage instructions.Stage,
	directives []directive.ShellDirective,
	stageInfo *semantic.StageInfo,
) string

Types

type Mapping

type Mapping struct {
	// Script is the extracted script body with Dockerfile syntax blanked out so
	// mvdan positions line up with the original Dockerfile columns.
	Script string

	// OriginStartLine is the 1-based Dockerfile line corresponding to script line 1.
	OriginStartLine int

	// FallbackLine is the 1-based Dockerfile line to use if precise mapping fails.
	FallbackLine int

	// IsHeredoc reports whether the script came from a heredoc body.
	IsHeredoc bool

	// ShellNameOverride overrides the stage shell when the heredoc is explicitly
	// fed to another shell, for example `RUN <<EOF bash`.
	ShellNameOverride string
}

func ExtractHealthcheckCmdShellScript

func ExtractHealthcheckCmdShellScript(
	sm *sourcemap.SourceMap,
	node *dfparser.Node,
	escapeToken rune,
) (Mapping, bool)

func ExtractOnbuildRunScript

func ExtractOnbuildRunScript(sm *sourcemap.SourceMap, node *dfparser.Node, escapeToken rune) (Mapping, bool)

func ExtractRunScript

func ExtractRunScript(sm *sourcemap.SourceMap, node *dfparser.Node, escapeToken rune) (Mapping, bool)

func ExtractShellFormScript

func ExtractShellFormScript(
	sm *sourcemap.SourceMap,
	node *dfparser.Node,
	escapeToken rune,
	keyword string,
) (Mapping, bool)

Jump to

Keyboard shortcuts

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