github.com/michael-k/docker@v1.7.0-rc2/pkg/chrootarchive/init.go (about)

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