Documentation
¶
Index ¶
- func CommandStartLine(location []dfparser.Range) int
- func NormalizeContinuation(script string, escapeToken, target rune) string
- type Mapping
- func ExtractHealthcheckCmdShellScript(sm *sourcemap.SourceMap, node *dfparser.Node, escapeToken rune) (Mapping, bool)
- func ExtractOnbuildRunScript(sm *sourcemap.SourceMap, node *dfparser.Node, escapeToken rune) (Mapping, bool)
- func ExtractRunScript(sm *sourcemap.SourceMap, node *dfparser.Node, escapeToken rune) (Mapping, bool)
- func ExtractShellFormScript(sm *sourcemap.SourceMap, node *dfparser.Node, escapeToken rune, keyword string) (Mapping, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandStartLine ¶
func NormalizeContinuation ¶ added in v0.27.2
NormalizeContinuation rewrites Dockerfile escape tokens at the end of each line into the target shell's native line-continuation character. This is a no-op when the escape token already matches the target (e.g. backtick escape with PowerShell, or backslash escape with POSIX shells).
Callers should choose target based on the shell variant:
POSIX shells (bash, sh, …) → '\\' PowerShell → '`' cmd.exe → '^'
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 ExtractOnbuildRunScript ¶
func ExtractRunScript ¶
Click to show internal directories.
Click to hide internal directories.