chore(docker): use heredoc syntax for multi-step RUN blocks#2433
Open
dunglas wants to merge 1 commit into
Open
chore(docker): use heredoc syntax for multi-step RUN blocks#2433dunglas wants to merge 1 commit into
dunglas wants to merge 1 commit into
Conversation
Convert multi-command RUN instructions across all six Dockerfiles from '\\'-continuation joined with '&&' to <<EOF heredoc form. Each script becomes one command per line, easier to scan and edit. Heredoc bodies start with 'set -e' where SHELL doesn't already imply it (bash builder stages in Dockerfile, dev.Dockerfile, and static-builder-gnu.Dockerfile). Alpine/ash SHELL declarations already include '-e', so it stays implicit there. The e-dant/watcher install block in Dockerfile and alpine.Dockerfile is intentionally left alone here — #2432 already converts those specifically.
Contributor
There was a problem hiding this comment.
Pull request overview
Converts multi-command RUN instructions in all six Dockerfiles from \-continuation + && chains to <<EOF heredoc form, making the steps easier to scan and diff. Explicit set -e is added at the top of heredoc bodies where the configured SHELL does not already imply errexit (bash variants); ash-based SHELLs already include -e so no explicit guard is added.
Changes:
- Rewrite multi-line
RUNblocks in all six Dockerfiles to BuildKit heredoc syntax. - Add
set -e/set -euxwhere the activeSHELLlacks errexit. - Drop two broken in-list
# comment \lines (would have been consumed as shell comments) and simplify a couple ofif/then/elsearch detection blocks.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Dockerfile | Convert four RUN blocks to heredoc form with explicit set -e/set -eux. |
| alpine.Dockerfile | Convert four RUN blocks to heredoc; rely on ash -e SHELL where applicable. |
| dev.Dockerfile | Convert install/build/watcher RUN blocks to heredoc; add set -e; drop broken # Dev tools comment. |
| dev-alpine.Dockerfile | Convert install/build/watcher RUN blocks to heredoc; drop two broken inline comments. |
| static-builder-musl.Dockerfile | Convert the apk add + xcaddy install RUN to heredoc form. |
| static-builder-gnu.Dockerfile | Convert three RUN blocks (yum setup, arch-specific SCL repo logic, build-essentials) to heredoc form with set -e. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Converts multi-command RUN instructions across all six Dockerfiles from \-continuation + && chains to `<<EOF` heredoc form:
Each step becomes one command per line — easier to scan, easier to diff, and no more trailing-backslash bookkeeping.
Notes