Documentation
¶
Overview ¶
Package heredoc provides utilities for formatting heredoc RUN instructions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatWithMounts ¶
func FormatWithMounts(commands []string, mounts []*instructions.Mount, variant shell.Variant, pipefail bool) string
FormatWithMounts formats commands as a heredoc RUN instruction. If mounts are provided, they are included in the RUN instruction.
For POSIX shells we prepend "set -e" (and optionally "set -o pipefail") to preserve the fail-fast semantics of && chains. For PowerShell we prepend "$ErrorActionPreference = 'Stop'" and "$PSNativeCommandUseErrorActionPreference = $true" so modern PowerShell also treats native command failures as errors. For cmd.exe we keep the original && chain semantics in a single parenthesized command block; Docker-validated WCOW heredoc bodies do not reliably execute multi-line cmd chains even with caret continuations.
See: https://github.com/moby/buildkit/issues/2722 See: https://github.com/moby/buildkit/issues/4195
Types ¶
This section is empty.