Skip to content

Fix docker build ignoring remote context download errors - #7374

Closed
bunnysayzz wants to merge 1 commit into
docker:masterfrom
bunnysayzz:fix/remote-context-error-7372
Closed

bunnysayzz wants to merge 1 commit into
docker:masterfrom
bunnysayzz:fix/remote-context-error-7372

Conversation

@bunnysayzz

Copy link
Copy Markdown

Fixes: #7372

Summary

runBuild swallowed errors from GetContextFromURL. When the remote context download failed (e.g. HTTP 404), the remote-context branch only flushed the progress buffer in quiet mode and fell through with a nil build context, so the CLI tarred an empty context and sent it to the daemon instead of reporting the download error. Every other context-type branch returns the error. This makes the remote branch do the same, after the quiet-mode flush.

Change is in cli/command/image/build.go (runBuild, build.ContextTypeRemote case).

Release notes

Fix `docker build` ignoring download errors for remote build contexts; the CLI now reports the download error instead of proceeding with an empty context.

Verification: traced the code path at current master; the fix mirrors the error handling of the stdin/local/git branches. No Go toolchain on this machine, so not compiled or run here.

When the remote context download fails (e.g. HTTP 404), runBuild
swallowed the error and continued with a nil build context, tarring an
empty context and sending it to the daemon. Every other context-type
branch returns the error; the remote branch only flushed the progress
buffer in quiet mode and fell through.

Return the download error like the other branches do, after flushing
the progress buffer in quiet mode.

Signed-off-by: bunnysayzz <stfuazzo@gmail.com>
@thaJeztah

Copy link
Copy Markdown
Member

duplicate of #7373

@thaJeztah thaJeztah closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker build ignores remote context download errors

2 participants