docker

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package docker is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoDockerClient is returned when the docker constructors in this
	// package take a nil Docker client instance
	ErrNoDockerClient = errors.New("no docker client provided")
)

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder is used to build images with the docker daemon

func NewBuilder

func NewBuilder(
	ctx context.Context,
	client dockerBuilder,
	componentPath string,
	credsStore credentials.Store,
	dryRun bool,
	opts ...BuilderOptionFn,
) (*Builder, error)

NewBuilder returns a bootstraped instance of the Builder object

func (*Builder) Build

Build is invoked to build an image for a component. The component should

func (*Builder) Report

func (b *Builder) Report() images.Report

Report returns a report of all the images built and how they were built

type BuilderOptionFn

type BuilderOptionFn func(*builderOptions)

BuilderOptionFn is used to modify the options passed to the builder

func PushImages

func PushImages() BuilderOptionFn

PushImages will cause all images to be built and pushed immediately

func WithBaseDockerfilePath

func WithBaseDockerfilePath(dockerfilePath string) BuilderOptionFn

WithBaseDockerfilePath sets the base Dockerfile that will be used to build all the components

func WithLabels

func WithLabels(labelMap map[string]string) BuilderOptionFn

WithLabels overrides the labels that will be set in the component image to be built

func WithPlatform

func WithPlatform(p string) BuilderOptionFn

WithPlatform will cause the images to be built for a platform that is not the native platform of the docker daemon

func WithSDKVersion

func WithSDKVersion(version string) BuilderOptionFn

WithSDKVersion customises the sdk version.

type Client

type Client interface {
	ImagePull(ctx context.Context, refStr string, options dockerimagetypes.PullOptions) (io.ReadCloser, error)
	// contains filtered or unexported methods
}

type MockdockerBuilder

type MockdockerBuilder struct {
	// contains filtered or unexported fields
}

MockdockerBuilder is a mock of dockerBuilder interface.

func NewMockdockerBuilder

func NewMockdockerBuilder(ctrl *gomock.Controller) *MockdockerBuilder

NewMockdockerBuilder creates a new mock instance.

func (*MockdockerBuilder) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockdockerBuilder) ImageBuild

func (m *MockdockerBuilder) ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)

ImageBuild mocks base method.

func (*MockdockerBuilder) ImagePush

func (m *MockdockerBuilder) ImagePush(ctx context.Context, image string, options image.PushOptions) (io.ReadCloser, error)

ImagePush mocks base method.

func (*MockdockerBuilder) ServerVersion

func (m *MockdockerBuilder) ServerVersion(ctx context.Context) (types.Version, error)

ServerVersion mocks base method.

type MockdockerBuilderMockRecorder

type MockdockerBuilderMockRecorder struct {
	// contains filtered or unexported fields
}

MockdockerBuilderMockRecorder is the mock recorder for MockdockerBuilder.

func (*MockdockerBuilderMockRecorder) ImageBuild

func (mr *MockdockerBuilderMockRecorder) ImageBuild(ctx, buildContext, options any) *gomock.Call

ImageBuild indicates an expected call of ImageBuild.

func (*MockdockerBuilderMockRecorder) ImagePush

func (mr *MockdockerBuilderMockRecorder) ImagePush(ctx, image, options any) *gomock.Call

ImagePush indicates an expected call of ImagePush.

func (*MockdockerBuilderMockRecorder) ServerVersion

func (mr *MockdockerBuilderMockRecorder) ServerVersion(ctx any) *gomock.Call

ServerVersion indicates an expected call of ServerVersion.

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver uses the docker client to pull an image

func NewResolver

func NewResolver(client dockerPuller, credsStore credentials.Store, dryRun bool) (*Resolver, error)

NewResolver returns a bootstrapped instance of the resolver based on a Docker client

func (*Resolver) Report

func (r *Resolver) Report() images.Report

Report returns a report of all the images that the resolver pulled

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, imageRef string, _ ...images.ResolutionOptionFn) (string, error)

Resolve fetches an image from a container registry

type ResolverBuilder

type ResolverBuilder struct {
	// contains filtered or unexported fields
}

ResolverBuilder is a struct that resolves the path to a component and builds the component image in a standardised way. If the image is not one of the component images, it will be pulled

func NewResolverBuilder

func NewResolverBuilder(
	ctx context.Context,
	client Client,
	componentPath string,
	credsStore credentials.Store,
	dryRun bool,
	opts ...BuilderOptionFn,
) (*ResolverBuilder, error)

NewResolverBuilder returns an instance of the ResolverBuilder which will pull images unless they are referring to smithy components with the latest tag

func (*ResolverBuilder) Report

func (r *ResolverBuilder) Report() images.Report

Report returns a report of all the images that have been resolved or built

func (*ResolverBuilder) Resolve

func (r *ResolverBuilder) Resolve(
	ctx context.Context,
	imageRef string,
	options ...images.ResolutionOptionFn,
) (string, error)

Resolve will attempt to pull an image unless it refers to a Smithy component and is not tagged with latest

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL