build.go 1.4 KB

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