build.go 1.3 KB

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