mirror of https://github.com/docker/compose.git
close sdtin stream on EOF to propagate exec process' stdin
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
41d5eb45b1
commit
bee156fb97
|
@ -72,7 +72,7 @@ func (s *composeService) Exec(ctx context.Context, project *types.Project, opts
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
defer resp.Close()
|
defer resp.Close() //nolint:errcheck
|
||||||
|
|
||||||
if opts.Tty {
|
if opts.Tty {
|
||||||
s.monitorTTySize(ctx, exec.ID, s.apiClient.ContainerExecResize)
|
s.monitorTTySize(ctx, exec.ID, s.apiClient.ContainerExecResize)
|
||||||
|
@ -118,11 +118,13 @@ func (s *composeService) interactiveExec(ctx context.Context, opts api.RunOption
|
||||||
_, err := stdcopy.StdCopy(opts.Stdout, opts.Stderr, stdout)
|
_, err := stdcopy.StdCopy(opts.Stdout, opts.Stderr, stdout)
|
||||||
outputDone <- err
|
outputDone <- err
|
||||||
}
|
}
|
||||||
|
defer stdout.Close() //nolint:errcheck
|
||||||
}()
|
}()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
_, err := io.Copy(stdin, r)
|
_, err := io.Copy(stdin, r)
|
||||||
inputDone <- err
|
inputDone <- err
|
||||||
|
defer stdin.Close() //nolint:errcheck
|
||||||
}()
|
}()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
|
Loading…
Reference in New Issue