Documentation ¶
Index ¶
- Constants
- type DockerBuildCmd
- func (b *DockerBuildCmd) AddAuth(username, password, registry string) error
- func (b *DockerBuildCmd) AddBuildArgs(arg string, value string) error
- func (b *DockerBuildCmd) AddBuildContext(dockercontexts ...buildcontext.DockerBuildContexter) error
- func (b *DockerBuildCmd) AddLabel(label string, value string) error
- func (b *DockerBuildCmd) AddPushAuth(username, password string) error
- func (b *DockerBuildCmd) AddTags(tags ...string) error
- func (b *DockerBuildCmd) Run(ctx context.Context) error
- func (b *DockerBuildCmd) WithDockerfile(dockerfile string) *DockerBuildCmd
- func (b *DockerBuildCmd) WithImageName(name string) *DockerBuildCmd
- func (b *DockerBuildCmd) WithPullParentImage() *DockerBuildCmd
- func (b *DockerBuildCmd) WithPushAfterBuild() *DockerBuildCmd
- func (b *DockerBuildCmd) WithRemoveAfterPush() *DockerBuildCmd
- func (b *DockerBuildCmd) WithResponse(res types.Responser) *DockerBuildCmd
- func (b *DockerBuildCmd) WithUseNormalizedNamed() *DockerBuildCmd
Constants ¶
const ( // DefaultDockerfile is the default filename for Dockerfile DefaultDockerfile string = "Dockerfile" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerBuildCmd ¶
type DockerBuildCmd struct { // Cli is the docker api client Cli types.DockerClienter // ImageName is the name of the image ImageName string // ImageBuildOptions from docker sdk ImageBuildOptions *dockertypes.ImageBuildOptions // ImagePushOptions from docker sdk ImagePushOptions *dockertypes.ImagePushOptions // PullParentImage if true pull parent image PullParentImage bool // PushAfterBuild when is true images are automatically pushed to registry after build PushAfterBuild bool // Response manages responses from docker client Response types.Responser // UseNormalizedNamed when is true tags are transformed to a fully qualified reference UseNormalizedNamed bool // RemoveAfterPush when is true images are removed from local after push RemoveAfterPush bool }
DockerBuilderCmd
func NewDockerBuildCmd ¶ added in v0.5.0
func NewDockerBuildCmd(cli types.DockerClienter) *DockerBuildCmd
NewDockerBuildCmd return a DockerBuildCmd
func (*DockerBuildCmd) AddAuth ¶ added in v0.4.0
func (b *DockerBuildCmd) AddAuth(username, password, registry string) error
AddAuth append new tags to DockerBuilder
func (*DockerBuildCmd) AddBuildArgs ¶ added in v0.4.0
func (b *DockerBuildCmd) AddBuildArgs(arg string, value string) error
AddBuildArgs append new tags to DockerBuilder. Returns an error when adding an existing argument
func (*DockerBuildCmd) AddBuildContext ¶ added in v0.4.0
func (b *DockerBuildCmd) AddBuildContext(dockercontexts ...buildcontext.DockerBuildContexter) error
AddBuildContext include the docker build context. It supports to use several context which are merged before to start the image build
func (*DockerBuildCmd) AddLabel ¶ added in v0.5.0
func (b *DockerBuildCmd) AddLabel(label string, value string) error
AddLabel append new tags to DockerBuilder. Returns an error when adding an existing label
func (*DockerBuildCmd) AddPushAuth ¶ added in v0.4.0
func (b *DockerBuildCmd) AddPushAuth(username, password string) error
AddPushAuth append new tags to DockerBuilder
func (*DockerBuildCmd) AddTags ¶ added in v0.4.0
func (b *DockerBuildCmd) AddTags(tags ...string) error
AddTags append new tags to DockerBuilder
func (*DockerBuildCmd) Run ¶
func (b *DockerBuildCmd) Run(ctx context.Context) error
Run execute the docker build https://docs.docker.com/engine/api/v1.39/#operation/ImageBuild
func (*DockerBuildCmd) WithDockerfile ¶ added in v0.5.0
func (b *DockerBuildCmd) WithDockerfile(dockerfile string) *DockerBuildCmd
WithDockerfile set responser attribute to DockerBuildCmd
func (*DockerBuildCmd) WithImageName ¶ added in v0.6.0
func (b *DockerBuildCmd) WithImageName(name string) *DockerBuildCmd
WithImageName set to push image automatically after its build
func (*DockerBuildCmd) WithPullParentImage ¶ added in v0.7.0
func (b *DockerBuildCmd) WithPullParentImage() *DockerBuildCmd
WithPullParentImage set to pull parent image
func (*DockerBuildCmd) WithPushAfterBuild ¶ added in v0.5.0
func (b *DockerBuildCmd) WithPushAfterBuild() *DockerBuildCmd
WithPushAfterBuild set to push image automatically after its build
func (*DockerBuildCmd) WithRemoveAfterPush ¶ added in v0.5.0
func (b *DockerBuildCmd) WithRemoveAfterPush() *DockerBuildCmd
WithRemoveAfterPush set to remove source image once the image is pushed
func (*DockerBuildCmd) WithResponse ¶ added in v0.5.0
func (b *DockerBuildCmd) WithResponse(res types.Responser) *DockerBuildCmd
WithResponse set responser attribute to DockerBuildCmd
func (*DockerBuildCmd) WithUseNormalizedNamed ¶ added in v0.5.0
func (b *DockerBuildCmd) WithUseNormalizedNamed() *DockerBuildCmd
WithUseNormalizedNamed set to use normalized named to DockerBuildCmd