github.com/wulonghui/docker@v1.8.0-rc2/pkg/chrootarchive/init_unix.go (about)

     1  // +build !windows
     2  
     3  package chrootarchive
     4  
     5  import (
     6  	"fmt"
     7  	"io"
     8  	"io/ioutil"
     9  	"os"
    10  
    11  	"github.com/docker/docker/pkg/reexec"
    12  )
    13  
    14  func init() {
    15  	reexec.Register("docker-applyLayer", applyLayer)
    16  	reexec.Register("docker-untar", untar)
    17  }
    18  
    19  func fatal(err error) {
    20  	fmt.Fprint(os.Stderr, err)
    21  	os.Exit(1)
    22  }
    23  
    24  // flush consumes all the bytes from the reader discarding
    25  // any errors
    26  func flush(r io.Reader) {
    27  	io.Copy(ioutil.Discard, r)
    28  }