Class DockerBuildImageTask
- java.lang.Object
-
- com.atlassian.bamboo.specs.api.builders.EntityPropertiesBuilder<P>
-
- com.atlassian.bamboo.specs.api.builders.task.Task<T,P>
-
- com.atlassian.bamboo.specs.builders.task.AbstractDockerTask<DockerBuildImageTask,DockerBuildImageTaskProperties>
-
- com.atlassian.bamboo.specs.builders.task.DockerBuildImageTask
-
public class DockerBuildImageTask extends AbstractDockerTask<DockerBuildImageTask,DockerBuildImageTaskProperties>
Task to build docker image.
-
-
Field Summary
-
Fields inherited from class com.atlassian.bamboo.specs.builders.task.AbstractDockerTask
environmentVariables, workingSubdirectory
-
Fields inherited from class com.atlassian.bamboo.specs.api.builders.task.Task
conditions, description, requirements, taskEnabled
-
-
Constructor Summary
Constructors Constructor Description DockerBuildImageTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DockerBuildImageTaskadditionalArguments(java.lang.String additionalArguments)Specifies additional build options, see https://docs.docker.com/engine/reference/commandline/build/.protected @NotNull DockerBuildImageTaskPropertiesbuild()DockerBuildImageTaskdockerfile(java.lang.String dockerfile)Specifies content of a Dockerfile.DockerBuildImageTaskdockerfileFromPath(@NotNull java.nio.file.Path path)Specifies content of a Dockerfile with content of a file.DockerBuildImageTaskdockerfileInWorkingDir()Task will use Dockerfile which should be available in a working directory.booleanequals(java.lang.Object o)inthashCode()DockerBuildImageTaskimageFilename(java.lang.String imageFilename)Specifies name of the file to which image will be saved.DockerBuildImageTaskimageName(@NotNull java.lang.String imageName)Sets the image name.DockerBuildImageTasksaveAsFile(boolean saveAsFile)If set to true Docker image will be saved to file.DockerBuildImageTaskuseCache(boolean useCache)Specifies if cache should be used.-
Methods inherited from class com.atlassian.bamboo.specs.builders.task.AbstractDockerTask
environmentVariables, workingSubdirectory
-
Methods inherited from class com.atlassian.bamboo.specs.api.builders.task.Task
conditions, description, enabled, requirements, toString
-
-
-
-
Method Detail
-
imageName
public DockerBuildImageTask imageName(@NotNull @NotNull java.lang.String imageName)
Sets the image name. You can also optionally specify repository, namespace and a tag. E.g. registry.address:port/namespace/repository:tagThis field is mandatory.
-
dockerfileInWorkingDir
public DockerBuildImageTask dockerfileInWorkingDir()
Task will use Dockerfile which should be available in a working directory.
-
dockerfile
public DockerBuildImageTask dockerfile(java.lang.String dockerfile)
Specifies content of a Dockerfile.Specifying content of a Dockerfile is mandatory, unless you use
dockerfileInWorkingDir()
-
dockerfileFromPath
public DockerBuildImageTask dockerfileFromPath(@NotNull @NotNull java.nio.file.Path path)
Specifies content of a Dockerfile with content of a file. File must be available on the path when running Bamboo Specs.Specifying content of a Dockerfile is mandatory, unless you use
dockerfileInWorkingDir()
-
useCache
public DockerBuildImageTask useCache(boolean useCache)
Specifies if cache should be used. Defaults to true.
-
saveAsFile
public DockerBuildImageTask saveAsFile(boolean saveAsFile)
If set to true Docker image will be saved to file.If sets to true
imageFilenamemust be specified.
-
imageFilename
public DockerBuildImageTask imageFilename(java.lang.String imageFilename)
Specifies name of the file to which image will be saved.
-
additionalArguments
public DockerBuildImageTask additionalArguments(java.lang.String additionalArguments)
Specifies additional build options, see https://docs.docker.com/engine/reference/commandline/build/.
-
build
@NotNull protected @NotNull DockerBuildImageTaskProperties build()
- Specified by:
buildin classTask<DockerBuildImageTask,DockerBuildImageTaskProperties>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classAbstractDockerTask<DockerBuildImageTask,DockerBuildImageTaskProperties>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classAbstractDockerTask<DockerBuildImageTask,DockerBuildImageTaskProperties>
-
-