mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
d1faf3df27
Redefine a better interface for remote context dependency. Separate Dockerfile build instruction from remote context. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
20 lines
663 B
Go
20 lines
663 B
Go
package build
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/docker/docker/api/types"
|
|
"github.com/docker/docker/api/types/backend"
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
// Backend abstracts an image builder whose only purpose is to build an image referenced by an imageID.
|
|
type Backend interface {
|
|
// BuildFromContext 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
|
|
BuildFromContext(ctx context.Context, src io.ReadCloser, buildOptions *types.ImageBuildOptions, pg backend.ProgressWriter) (string, error)
|
|
}
|