Merge pull request #8321 from erikh/ui_save_output

docker save: Do not save to a terminal.
This commit is contained in:
Tibor Vass
2014-10-24 19:37:14 -04:00
2 changed files with 35 additions and 0 deletions
+4
View File
@@ -5,6 +5,7 @@ import (
"bytes"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
@@ -2411,7 +2412,10 @@ func (cli *DockerCli) CmdSave(args ...string) error {
if err != nil {
return err
}
} else if cli.isTerminalOut {
return errors.New("Cowardly refusing to save to a terminal. Use the -o flag or redirect.")
}
if len(cmd.Args()) == 1 {
image := cmd.Arg(0)
if err := cli.stream("GET", "/images/"+image+"/get", nil, output, nil); err != nil {