func BuildPushImages(ctx context.Context, backend Backend, fs filesystem.Filesystem, push bool) error
BuildPushImages build all images defined in the devfile with the detected backend If push is true, also push the images to their registries
func BuildPushSpecificImage(ctx context.Context, backend Backend, fs filesystem.Filesystem, component devfile.Component, push bool) error
BuildPushSpecificImage build an image defined in the devfile present in devfilePath If push is true, also push the image to its registry
Backend is in interface that must be implemented by container runtimes
type Backend interface { // Build the image as defined in the devfile. // The filesystem specified will be used to download and store the Dockerfile if it is referenced as a remote URL. Build(fs filesystem.Filesystem, image *devfile.ImageComponent, devfilePath string) error // Push the image to its registry as defined in the devfile Push(image string) error // Return the name of the backend String() string }
func SelectBackend(ctx context.Context) Backend
SelectBackend selects the container backend to use for building and pushing images It will detect podman and docker CLIs (in this order), or return nil if none are present locally
DockerCompatibleBackend uses a CLI compatible with the docker CLI (at least docker itself and podman)
type DockerCompatibleBackend struct {
// contains filtered or unexported fields
}
func NewDockerCompatibleBackend(name string, globalExtraArgs, imageBuildExtraArgs []string) *DockerCompatibleBackend
func (o *DockerCompatibleBackend) Build(fs filesystem.Filesystem, image *devfile.ImageComponent, devfilePath string) error
Build an image, as defined in devfile, using a Docker compatible CLI
func (o *DockerCompatibleBackend) Push(image string) error
Push an image to its registry using a Docker compatible CLI
func (o *DockerCompatibleBackend) String() string
String return the name of the docker compatible CLI used
MockBackend is a mock of Backend interface.
type MockBackend struct {
// contains filtered or unexported fields
}
func NewMockBackend(ctrl *gomock.Controller) *MockBackend
NewMockBackend creates a new mock instance.
func (m *MockBackend) Build(fs filesystem.Filesystem, image *v1alpha2.ImageComponent, devfilePath string) error
Build mocks base method.
func (m *MockBackend) EXPECT() *MockBackendMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBackend) Push(image string) error
Push mocks base method.
func (m *MockBackend) String() string
String mocks base method.
MockBackendMockRecorder is the mock recorder for MockBackend.
type MockBackendMockRecorder struct {
// contains filtered or unexported fields
}
func (mr *MockBackendMockRecorder) Build(fs, image, devfilePath interface{}) *gomock.Call
Build indicates an expected call of Build.
func (mr *MockBackendMockRecorder) Push(image interface{}) *gomock.Call
Push indicates an expected call of Push.
func (mr *MockBackendMockRecorder) String() *gomock.Call
String indicates an expected call of String.