Skip to content

Commit 35454ba

Browse files
authored
fix(cli): keep docker login output out of build logs (#4909)
On self-hosted and local builds, the registry login step's output landed in the shared build log buffer, so every build log carried docker's `WARNING! Your credentials are stored unencrypted` block. The warning is misleading in our context: the credentials are per-project, short-lived deploy tokens on an ephemeral builder machine. Login output now goes to debug logging only; a single `Logged in to <registry>` marker is pushed into the build log on success (so failure logs still show auth ran), and a failed login still returns its full output.
1 parent 7fb8217 commit 35454ba

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)