Flush stdin from within chroot archive
This makes sure that we don't buffer in memory and that we also flush stdin from diff as well as untar. Signed-off-by: Michael Crosby <crosbymichael@gmail.com> Conflicts: pkg/chrootarchive/diff.go
This commit is contained in:
parent
a8124280d2
commit
cd74be68b8
4 changed files with 27 additions and 4 deletions
|
@ -2,6 +2,8 @@ package chrootarchive
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/docker/docker/pkg/reexec"
|
||||
|
@ -16,3 +18,9 @@ func fatal(err error) {
|
|||
fmt.Fprint(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// flush consumes all the bytes from the reader discarding
|
||||
// any errors
|
||||
func flush(r io.Reader) {
|
||||
io.Copy(ioutil.Discard, r)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue