Exercise 1: The Same sed Command Behaves Differently on Alpine — Possible Solution ==================================================================== WHAT'S ACTUALLY RUNNING sed ON EACH RUNNER ------------------------------ Per this chapter, "instead of the full GNU coreutils most distros ship, Alpine uses BusyBox - a single, compact executable providing simplified implementations of dozens of standard Unix utilities (ls, grep, sed, mount, and many more) at once." The Ubuntu-based runner is executing the full GNU version of sed; the Alpine-based runner is executing BusyBox's own trimmed sed implementation - two genuinely different programs both invoked by the same command name. WHY THIS PRODUCES DIFFERENT OUTPUT FROM THE SAME COMMAND ------------------------------ Per this chapter, "the trade-off is real: a dramatic size reduction, in exchange for a reduced feature set and occasionally different flag behavior than the full GNU version of the same command - a script written assuming GNU-specific sed or grep flags can behave differently under BusyBox's own trimmed implementation." If the pipeline's script relies on a GNU-specific sed flag or behavior (extended regex handling, a specific in-place-edit flag variant, or similar), BusyBox's own sed may interpret it differently or not support it identically, producing different output even though the command text is identical. WHY THIS ISN'T AN ALPINE BUG ------------------------------ Both sed implementations are working correctly according to their own respective feature sets - BusyBox's sed isn't malfunctioning, it simply implements a smaller, sometimes differently-behaved subset of what GNU sed offers. The script's assumption that "sed" always means "GNU sed" is what breaks, not either tool itself. WHAT TO DO ABOUT IT ------------------------------ Confirming exactly which GNU-specific flags or behaviors the script relies on, then either rewriting the script to avoid them (using only behavior common to both implementations) or ensuring the CI pipeline installs GNU sed explicitly on the Alpine runner, would resolve the inconsistency - treating it as a portability issue to fix rather than an unexplained platform quirk. WHY THIS WORKS AS AN ANSWER ------------------------------ It identifies BusyBox's own sed as a genuinely different implementation from GNU sed using this chapter's own explanation, explains why relying on GNU-specific behavior produces the discrepancy, and gives concrete next steps rather than treating the difference as unexplained.