mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-28 17:10:09 +00:00
Merge pull request #8321 from erikh/ui_save_output
docker save: Do not save to a terminal.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user