Skip to content

Commit c4266ec

Browse files
committed
fix(cli): keep docker login output out of build logs
The registry login step's output was collected into the shared build log buffer, so build logs on self-hosted and local builds always carried docker's unencrypted-credentials warning — most confusingly right next to the real error on failed builds. Route login output to debug logging only, push a single 'Logged in to <registry>' marker into the build log on success, and keep returning the full login output when the login itself fails.
1 parent 83af2d2 commit c4266ec

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

.changeset/dry-mirrors-shake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Build logs no longer include docker's registry login output, most notably the credential-storage warning on failed builds.

packages/cli-v3/src/deploy/buildImage.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,19 +514,25 @@ async function localBuildImage(options: SelfHostedBuildImageOptions): Promise<Bu
514514
loginProcess.process?.stdin?.write(credentials.password);
515515
loginProcess.process?.stdin?.end();
516516

517+
// Login output (incl. docker's credential-storage warning) stays out of the build
518+
// logs; it is fully visible at debug level and returned when the login itself fails.
519+
const loginLogs: string[] = [];
520+
517521
for await (const line of loginProcess) {
518-
errors.push(line);
522+
loginLogs.push(line);
519523
logger.debug(line);
520524
}
521525

522526
if (loginProcess.exitCode !== 0) {
523527
return {
524528
ok: false as const,
525529
error: `Failed to login to registry: ${cloudRegistryHost}`,
526-
logs: extractLogs(errors),
530+
logs: extractLogs(loginLogs),
527531
};
528532
}
529533

534+
// `errors` is the shared build log buffer; keep a marker there so failure logs show auth ran
535+
errors.push(`Logged in to ${cloudRegistryHost}`);
530536
options.onLog?.(`Successfully logged in to the remote registry`);
531537
}
532538

0 commit comments

Comments
 (0)