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