2017-04-13 18:37:32 +00:00
|
|
|
package backend
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/docker/docker/api/types"
|
2017-04-06 12:33:56 +00:00
|
|
|
"github.com/docker/docker/pkg/streamformatter"
|
2017-04-13 18:37:32 +00:00
|
|
|
)
|
|
|
|
|
2017-06-20 00:15:23 +00:00
|
|
|
// PullOption defines different modes for accessing images
|
|
|
|
type PullOption int
|
|
|
|
|
|
|
|
const (
|
|
|
|
// PullOptionNoPull only returns local images
|
|
|
|
PullOptionNoPull PullOption = iota
|
|
|
|
// PullOptionForcePull always tries to pull a ref from the registry first
|
|
|
|
PullOptionForcePull
|
|
|
|
// PullOptionPreferLocal uses local image if it exists, otherwise pulls
|
|
|
|
PullOptionPreferLocal
|
|
|
|
)
|
|
|
|
|
2017-04-13 18:37:32 +00:00
|
|
|
// ProgressWriter is a data object to transport progress streams to the client
|
|
|
|
type ProgressWriter struct {
|
|
|
|
Output io.Writer
|
2017-05-01 18:54:56 +00:00
|
|
|
StdoutFormatter io.Writer
|
|
|
|
StderrFormatter io.Writer
|
2017-04-06 12:33:56 +00:00
|
|
|
AuxFormatter *streamformatter.AuxFormatter
|
2017-04-13 18:37:32 +00:00
|
|
|
ProgressReaderFunc func(io.ReadCloser) io.ReadCloser
|
|
|
|
}
|
|
|
|
|
|
|
|
// BuildConfig is the configuration used by a BuildManager to start a build
|
|
|
|
type BuildConfig struct {
|
|
|
|
Source io.ReadCloser
|
|
|
|
ProgressWriter ProgressWriter
|
|
|
|
Options *types.ImageBuildOptions
|
|
|
|
}
|
2017-03-28 01:36:28 +00:00
|
|
|
|
2017-05-05 22:52:11 +00:00
|
|
|
// GetImageAndLayerOptions are the options supported by GetImageAndReleasableLayer
|
2017-03-28 01:36:28 +00:00
|
|
|
type GetImageAndLayerOptions struct {
|
2017-06-20 00:15:23 +00:00
|
|
|
PullOption PullOption
|
2017-03-28 01:36:28 +00:00
|
|
|
AuthConfig map[string]types.AuthConfig
|
|
|
|
Output io.Writer
|
2017-08-08 19:43:48 +00:00
|
|
|
OS string
|
2017-03-28 01:36:28 +00:00
|
|
|
}
|