File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -478,7 +478,11 @@ export class DockerClient {
478478 ) : Promise < void > {
479479 const response = await this . api . upgrade (
480480 `/containers/${ id } /attach` ,
481- options ,
481+ options || {
482+ stdout : stdout != null ,
483+ stderr : stderr != null ,
484+ stream : stdout != null || stderr != null ,
485+ } ,
482486 ) ;
483487 switch ( response . content ) {
484488 case DOCKER_RAW_STREAM :
@@ -1641,6 +1645,11 @@ export class DockerClient {
16411645 stderr : stream . Writable | null ,
16421646 execStartConfig ?: types . ExecStartConfig ,
16431647 ) : Promise < void > {
1648+ // If no output streams and Detach not explicitly set, force detached mode
1649+ if ( stdout === null && stderr === null && execStartConfig ?. Detach === undefined ) {
1650+ await this . api . post ( `/exec/${ id } /start` , { ...execStartConfig , Detach : true } ) ;
1651+ return ;
1652+ }
16441653 if ( execStartConfig ?. Detach ) {
16451654 await this . api . post ( `/exec/${ id } /start` , execStartConfig ) ;
16461655 } else {
You can’t perform that action at this time.
0 commit comments