init_unix.go 462 B

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