heredoc

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

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