2015-12-17 19:17:50 -05:00
|
|
|
package build
|
|
|
|
|
2016-01-20 18:32:02 -05:00
|
|
|
import (
|
2016-03-18 17:42:40 -04:00
|
|
|
"io"
|
|
|
|
|
2016-09-06 14:46:37 -04:00
|
|
|
"github.com/docker/docker/api/types"
|
2016-03-29 18:51:14 -04:00
|
|
|
"github.com/docker/docker/api/types/backend"
|
2016-03-18 17:42:40 -04:00
|
|
|
"golang.org/x/net/context"
|
2016-01-20 18:32:02 -05:00
|
|
|
)
|
|
|
|
|
2015-12-17 19:17:50 -05:00
|
|
|
// Backend abstracts an image builder whose only purpose is to build an image referenced by an imageID.
|
|
|
|
type Backend interface {
|
|
|
|
// Build builds a Docker image referenced by an imageID string.
|
|
|
|
//
|
|
|
|
// Note: Tagging an image should not be done by a Builder, it should instead be done
|
|
|
|
// by the caller.
|
|
|
|
//
|
|
|
|
// TODO: make this return a reference instead of string
|
2016-03-29 18:51:14 -04:00
|
|
|
BuildFromContext(ctx context.Context, src io.ReadCloser, remote string, buildOptions *types.ImageBuildOptions, pg backend.ProgressWriter) (string, error)
|
2015-12-17 19:17:50 -05:00
|
|
|
}
|