mirror of
https://github.com/docker/compose.git
synced 2025-07-23 05:34:36 +02:00
Compose exec cannot process more than 32KB of data
Fixes #8811 Signed-off-by: Andreas Resios <andrei.resios@gmail.com>
This commit is contained in:
parent
c3a5eb2269
commit
85ef72585d
@ -90,7 +90,7 @@ func (s *composeService) interactiveExec(ctx context.Context, opts api.RunOption
|
|||||||
|
|
||||||
stdout := ContainerStdout{HijackedResponse: resp}
|
stdout := ContainerStdout{HijackedResponse: resp}
|
||||||
stdin := ContainerStdin{HijackedResponse: resp}
|
stdin := ContainerStdin{HijackedResponse: resp}
|
||||||
r, err := s.getEscapeKeyProxy(opts.Stdin)
|
r, err := s.getEscapeKeyProxy(opts.Stdin, opts.Tty)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ func (s *composeService) RunOneOffContainer(ctx context.Context, project *types.
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *composeService) runInteractive(ctx context.Context, containerID string, opts api.RunOptions) (int, error) {
|
func (s *composeService) runInteractive(ctx context.Context, containerID string, opts api.RunOptions) (int, error) {
|
||||||
r, err := s.getEscapeKeyProxy(opts.Stdin)
|
r, err := s.getEscapeKeyProxy(opts.Stdin, opts.Tty)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
@ -179,7 +179,10 @@ func (s *composeService) prepareRun(ctx context.Context, project *types.Project,
|
|||||||
return containerID, nil
|
return containerID, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *composeService) getEscapeKeyProxy(r io.ReadCloser) (io.ReadCloser, error) {
|
func (s *composeService) getEscapeKeyProxy(r io.ReadCloser, isTty bool) (io.ReadCloser, error) {
|
||||||
|
if isTty {
|
||||||
|
return r, nil
|
||||||
|
}
|
||||||
var escapeKeys = []byte{16, 17}
|
var escapeKeys = []byte{16, 17}
|
||||||
if s.configFile.DetachKeys != "" {
|
if s.configFile.DetachKeys != "" {
|
||||||
customEscapeKeys, err := term.ToBytes(s.configFile.DetachKeys)
|
customEscapeKeys, err := term.ToBytes(s.configFile.DetachKeys)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user