godockerbuilder

package
v0.11.5 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerBuilder

type DockerBuilder interface {
	WithDockerfile(string) *build.DockerBuildCmd
	WithImageName(string) *build.DockerBuildCmd
	WithPullParentImage() *build.DockerBuildCmd
	WithPushAfterBuild() *build.DockerBuildCmd
	WithResponse(types.Responser) *build.DockerBuildCmd
	WithUseNormalizedNamed() *build.DockerBuildCmd
	WithRemoveAfterPush() *build.DockerBuildCmd
	AddAuth(string, string, string) error
	AddPushAuth(string, string) error
	AddBuildArgs(string, string) error
	AddBuildContext(...godockerbuilderbuildcontext.DockerBuildContexter) error
	AddLabel(string, string) error
	AddTags(...string) error
	Run(context.Context) error
}

DockerBuilder defines a docker driver

type GoDockerBuildDriver

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

GoDockerBuildDriver is a driver for building docker images

func NewGoDockerBuildDriver

func NewGoDockerBuildDriver(cmd *build.DockerBuildCmd, contextFactory *buildcontext.DockerBuildContextFactory) *GoDockerBuildDriver

NewGoDockerBuildDriver creates a new GoDockerBuildDriver

func (*GoDockerBuildDriver) AddAuth

func (d *GoDockerBuildDriver) AddAuth(username string, password string, registry string) error

AddAuth defines the authentication to use for an specific registry

func (*GoDockerBuildDriver) AddBuildArgs

func (d *GoDockerBuildDriver) AddBuildArgs(arg string, value string) error

AddBuildArgs append new build args

func (*GoDockerBuildDriver) AddBuildContext

func (d *GoDockerBuildDriver) AddBuildContext(options ...*builder.DockerDriverContextOptions) error

AddBuildContext sets those docker build contexts required to build an image. It supports to use several context which are merged before to start the image build

func (*GoDockerBuildDriver) AddLabel

func (d *GoDockerBuildDriver) AddLabel(label string, value string) error

AddLabel adds a label to the image

func (*GoDockerBuildDriver) AddPushAuth

func (d *GoDockerBuildDriver) AddPushAuth(username string, password string) error

AddPushAuth defines the authentication to use for an specific registry

func (*GoDockerBuildDriver) AddTags

func (d *GoDockerBuildDriver) AddTags(tags ...string) error

AddTags adds tags to the image

func (*GoDockerBuildDriver) Run

Run starts the build

func (*GoDockerBuildDriver) WithDockerfile

func (d *GoDockerBuildDriver) WithDockerfile(dockerfile string)

WithDockerfile sets dockerfile to use

func (*GoDockerBuildDriver) WithImageName

func (d *GoDockerBuildDriver) WithImageName(image string)

WithImageName sets the image name

func (*GoDockerBuildDriver) WithPullParentImage

func (d *GoDockerBuildDriver) WithPullParentImage()

WithPullParentImage sets if the image should be pushed after build

func (*GoDockerBuildDriver) WithPushAfterBuild

func (d *GoDockerBuildDriver) WithPushAfterBuild()

WithPushAfterBuild sets if the image should be pushed after build

func (*GoDockerBuildDriver) WithRemoveAfterPush

func (d *GoDockerBuildDriver) WithRemoveAfterPush()

WithRemoveAfterPush sets if the image should be removed after push

func (*GoDockerBuildDriver) WithResponse

func (d *GoDockerBuildDriver) WithResponse(w io.Writer, prefix string)

WithResponse sets the responser to use

func (*GoDockerBuildDriver) WithUseNormalizedNamed

func (d *GoDockerBuildDriver) WithUseNormalizedNamed()

WithUseNormalizedNamed sets if image name should be normalized

type MockDockerBuildCmd

type MockDockerBuildCmd struct {
	mock.Mock
}

MockDockerBuildCmd is a mock for DockerBuildCmd "github.com/apenella/go-docker-builder/pkg/build"

func NewMockDockerBuildCmd

func NewMockDockerBuildCmd() *MockDockerBuildCmd

func (*MockDockerBuildCmd) AddAuth

func (d *MockDockerBuildCmd) AddAuth(username string, password string, registry string) error

AddAuth is a mock for AddAuth "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) AddBuildArgs

func (d *MockDockerBuildCmd) AddBuildArgs(arg string, value string) error

AddBuildArgs is a mock for AddBuildArgs "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) AddBuildContext

AddBuildContext is a mock for AddBuildContext "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) AddLabel

func (d *MockDockerBuildCmd) AddLabel(label string, value string) error

AddLabel is a mock for AddLabel "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) AddPushAuth

func (d *MockDockerBuildCmd) AddPushAuth(username string, password string) error

AddPushAuth is a mock for AddPushAuth "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) AddTags

func (d *MockDockerBuildCmd) AddTags(tags ...string) error

AddTags is a mock for AddTags "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) Run

Run is a mock for Run "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) WithDockerfile

func (d *MockDockerBuildCmd) WithDockerfile(dockerfile string) *build.DockerBuildCmd

WithDockerfile is a mock for WithDockerfile "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) WithImageName

func (d *MockDockerBuildCmd) WithImageName(image string) *build.DockerBuildCmd

WithImageName is a mock for WithImageName "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) WithPullParentImage

func (d *MockDockerBuildCmd) WithPullParentImage() *build.DockerBuildCmd

WithPullParentImage is a mock for WithPullParentImage "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) WithPushAfterBuild

func (d *MockDockerBuildCmd) WithPushAfterBuild() *build.DockerBuildCmd

WithPushAfterBuild is a mock for WithPushAfterBuild "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) WithRemoveAfterPush

func (d *MockDockerBuildCmd) WithRemoveAfterPush() *build.DockerBuildCmd

WithRemoveAfterPush is a mock for WithRemoveAfterPush "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) WithResponse

func (d *MockDockerBuildCmd) WithResponse(response types.Responser) *build.DockerBuildCmd

WithResponse is a mock for WithResponse "github.com/apenella/go-docker-builder/pkg/build"

func (*MockDockerBuildCmd) WithUseNormalizedNamed

func (d *MockDockerBuildCmd) WithUseNormalizedNamed() *build.DockerBuildCmd

WithUseNormalizedNamed is a mock for WithUseNormalizedNamed "github.com/apenella/go-docker-builder/pkg/build"

type MockGoDockerBuildDriver

type MockGoDockerBuildDriver struct {
	mock.Mock
}

MockGoDockerBuildDriver is a mocked docker driver

func NewMockGoDockerBuildDriver

func NewMockGoDockerBuildDriver() *MockGoDockerBuildDriver

NewMockGoDockerBuildDriver creates a new mock docker driver

func (*MockGoDockerBuildDriver) AddAuth

func (d *MockGoDockerBuildDriver) AddAuth(username string, password string, registry string) error

AddAuth is a mocked method

func (*MockGoDockerBuildDriver) AddBuildArgs

func (d *MockGoDockerBuildDriver) AddBuildArgs(arg string, value string) error

AddBuildArgs is a mocked method

func (*MockGoDockerBuildDriver) AddBuildContext

func (d *MockGoDockerBuildDriver) AddBuildContext(context ...*builder.DockerDriverContextOptions) error

AddBuildContext is a mocked method

func (*MockGoDockerBuildDriver) AddLabel

func (d *MockGoDockerBuildDriver) AddLabel(label string, value string) error

AddLabel is a mocked method

func (*MockGoDockerBuildDriver) AddPushAuth

func (d *MockGoDockerBuildDriver) AddPushAuth(username string, password string) error

AddPushAuth is a mocked method

func (*MockGoDockerBuildDriver) AddTags

func (d *MockGoDockerBuildDriver) AddTags(tags ...string) error

AddTags is a mocked method

func (*MockGoDockerBuildDriver) Run

Run is a mocked method

func (*MockGoDockerBuildDriver) WithDockerfile

func (d *MockGoDockerBuildDriver) WithDockerfile(dockerfile string)

WithDockerfile is a mocked method

func (*MockGoDockerBuildDriver) WithImageName

func (d *MockGoDockerBuildDriver) WithImageName(image string)

WithImageName is a mocked method

func (*MockGoDockerBuildDriver) WithPullParentImage

func (d *MockGoDockerBuildDriver) WithPullParentImage()

WithPullParentImage is a mocked method

func (*MockGoDockerBuildDriver) WithPushAfterBuild

func (d *MockGoDockerBuildDriver) WithPushAfterBuild()

WithPushAfterBuild is a mocked method

func (*MockGoDockerBuildDriver) WithRemoveAfterPush

func (d *MockGoDockerBuildDriver) WithRemoveAfterPush()

WithRemoveAfterPush is a mocked method

func (*MockGoDockerBuildDriver) WithResponse

func (d *MockGoDockerBuildDriver) WithResponse(w io.Writer, prefix string)

WithResponse is a mocked method

func (*MockGoDockerBuildDriver) WithUseNormalizedNamed

func (d *MockGoDockerBuildDriver) WithUseNormalizedNamed()

WithUseNormalizedNamed is a mocked method

Directories

Path Synopsis
git

Jump to

Keyboard shortcuts

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