build.go 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package backend
  2. import (
  3. "io"
  4. "github.com/docker/docker/api/types"
  5. "github.com/docker/docker/pkg/streamformatter"
  6. )
  7. // PullOption defines different modes for accessing images
  8. type PullOption int
  9. const (
  10. // PullOptionNoPull only returns local images
  11. PullOptionNoPull PullOption = iota
  12. // PullOptionForcePull always tries to pull a ref from the registry first
  13. PullOptionForcePull
  14. // PullOptionPreferLocal uses local image if it exists, otherwise pulls
  15. PullOptionPreferLocal
  16. )
  17. // ProgressWriter is a data object to transport progress streams to the client
  18. type ProgressWriter struct {
  19. Output io.Writer
  20. StdoutFormatter io.Writer
  21. StderrFormatter io.Writer
  22. AuxFormatter *streamformatter.AuxFormatter
  23. ProgressReaderFunc func(io.ReadCloser) io.ReadCloser
  24. }
  25. // BuildConfig is the configuration used by a BuildManager to start a build
  26. type BuildConfig struct {
  27. Source io.ReadCloser
  28. ProgressWriter ProgressWriter
  29. Options *types.ImageBuildOptions
  30. }
  31. // GetImageAndLayerOptions are the options supported by GetImageAndReleasableLayer
  32. type GetImageAndLayerOptions struct {
  33. PullOption PullOption
  34. AuthConfig map[string]types.AuthConfig
  35. Output io.Writer
  36. Platform string
  37. }