Documentation
¶
Overview ¶
Package docker is a generated GoMock package.
Index ¶
- Variables
- type Builder
- type BuilderOptionFn
- type Client
- type MockdockerBuilder
- func (m *MockdockerBuilder) EXPECT() *MockdockerBuilderMockRecorder
- func (m *MockdockerBuilder) ImageBuild(ctx context.Context, buildContext io.Reader, options types.ImageBuildOptions) (types.ImageBuildResponse, error)
- func (m *MockdockerBuilder) ImagePush(ctx context.Context, image string, options image.PushOptions) (io.ReadCloser, error)
- func (m *MockdockerBuilder) ServerVersion(ctx context.Context) (types.Version, error)
- type MockdockerBuilderMockRecorder
- type Resolver
- type ResolverBuilder
Constants ¶
This section is empty.
Variables ¶
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
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 ¶
func (m *MockdockerBuilder) EXPECT() *MockdockerBuilderMockRecorder
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 ¶
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
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