init_unix.go 556 B

1234567891011121314151617181920212223242526272829
  1. //go:build !windows
  2. // +build !windows
  3. package chrootarchive // import "github.com/docker/docker/pkg/chrootarchive"
  4. import (
  5. "fmt"
  6. "io"
  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. reexec.Register("docker-tar", tar)
  14. }
  15. func fatal(err error) {
  16. fmt.Fprint(os.Stderr, err)
  17. os.Exit(1)
  18. }
  19. // flush consumes all the bytes from the reader discarding
  20. // any errors
  21. func flush(r io.Reader) (bytes int64, err error) {
  22. return io.Copy(io.Discard, r)
  23. }