github.com/wozhu6104/docker@v20.10.10+incompatible/pkg/chrootarchive/init_unix.go (about)

     1  // +build !windows
     2  
     3  package chrootarchive // import "github.com/docker/docker/pkg/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  	reexec.Register("docker-tar", tar)
    18  }
    19  
    20  func fatal(err error) {
    21  	fmt.Fprint(os.Stderr, err)
    22  	os.Exit(1)
    23  }
    24  
    25  // flush consumes all the bytes from the reader discarding
    26  // any errors
    27  func flush(r io.Reader) (bytes int64, err error) {
    28  	return io.Copy(ioutil.Discard, r)
    29  }