Class BootBuildImage
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.springframework.boot.gradle.tasks.bundling.BootBuildImage
- All Implemented Interfaces:
Comparable<org.gradle.api.Task>,org.gradle.api.internal.DynamicObjectAware,org.gradle.api.internal.TaskInternal,org.gradle.api.plugins.ExtensionAware,org.gradle.api.Task,org.gradle.util.Configurable<org.gradle.api.Task>
@DisableCachingByDefault
public class BootBuildImage
extends org.gradle.api.DefaultTask
A
Task for bundling an application into an OCI image using a
buildpack.- Since:
- 2.3.0
- Author:
- Andy Wilkinson, Scott Frederick, Rafael Ceccone, Jeroen Meijer, Julian Liebig
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
org.gradle.api.Task.Namer -
Field Summary
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an entry to the volume bindings that will be mounted to the container when building the image.voidAdd entries to the volume bindings that will be mounted to the container when building the image.voidbuildCache(org.gradle.api.Action<CacheSpec> action) Customizes theCacheSpecfor the build cache using the givenaction.voidAdd an entry to the buildpacks that will be used when building the image.voidbuildpacks(List<String> buildpacks) Adds entries to the buildpacks that will be used when building the image.voiddocker(org.gradle.api.Action<DockerSpec> action) Configures the Docker connection using the givenaction.voidenvironment(String name, String value) Add an entry to the environment that will be used when building the image.voidenvironment(Map<String, String> entries) Adds entries to the environment that will be used when building the image.org.gradle.api.file.RegularFilePropertyReturns the property for the archive file from which the image will be built.Returns the volume bindings that will be mounted to the container when building the image.Returns the build cache that will be used when building the image.Returns the builder that will be used to build the image.Returns the buildpacks that will be used when building the image.Returns the Docker configuration the builder will use.Returns the environment that will be used when building the image.Returns the name of the image that will be built.Returns the launch cache that will be used when building the image.Returns the network the build container will connect to.org.springframework.boot.buildpack.platform.build.PullPolicyReturns image pull policy that will be used when building the image.Returns the run image that will be included in the built image.getTags()Returns the tags that will be created for the built image.org.gradle.api.provider.Property<org.gradle.api.JavaVersion>Returns the target Java version of the project (e.g.booleanReturns whether caches should be cleaned before packaging.booleanWhether the built image should be pushed to a registry.booleanWhether verbose logging should be enabled while building the image.voidlaunchCache(org.gradle.api.Action<CacheSpec> action) Customizes theCacheSpecfor the launch cache using the givenaction.voidsetBindings(List<String> bindings) Sets the volume bindings that will be mounted to the container when building the image.voidsetBuilder(String builder) Sets the builder that will be used to build the image.voidsetBuildpacks(List<String> buildpacks) Sets the buildpacks that will be used when building the image.voidsetCleanCache(boolean cleanCache) Sets whether caches should be cleaned before packaging.voidsetEnvironment(Map<String, String> environment) Sets the environment that will be used when building the image.voidsetImageName(String imageName) Sets the name of the image that will be built.voidsetNetwork(String network) Sets the network the build container will connect to.voidsetPublish(boolean publish) Sets whether the built image should be pushed to a registry.voidsetPullPolicy(org.springframework.boot.buildpack.platform.build.PullPolicy pullPolicy) Sets image pull policy that will be used when building the image.voidsetRunImage(String runImage) Sets the run image that will be included in the built image.voidSets the tags that will be created for the built image.voidsetVerboseLogging(boolean verboseLogging) Sets whether verbose logging should be enabled while building the image.voidAdd an entry to the tags that will be created for the built image.voidAdd entries to the tags that will be created for the built image.Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getOnlyIf, getReasonNotToTrackState, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, prependParallelSafeAction, setImpliesSubProjectsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention
-
Constructor Details
-
BootBuildImage
public BootBuildImage()
-
-
Method Details
-
getArchiveFile
@Input public org.gradle.api.file.RegularFileProperty getArchiveFile()Returns the property for the archive file from which the image will be built.- Returns:
- the archive file property
-
getTargetJavaVersion
@Input @Optional public org.gradle.api.provider.Property<org.gradle.api.JavaVersion> getTargetJavaVersion()Returns the target Java version of the project (e.g. as provided by thetargetCompatibilitybuild property).- Returns:
- the target Java version
-
getImageName
Returns the name of the image that will be built. Whennull, the name will be derived from theProject'snameandversion.- Returns:
- name of the image
-
setImageName
Sets the name of the image that will be built.- Parameters:
imageName- name of the image
-
getBuilder
Returns the builder that will be used to build the image. Whennull, the default builder will be used.- Returns:
- the builder
-
setBuilder
Sets the builder that will be used to build the image.- Parameters:
builder- the builder
-
getRunImage
Returns the run image that will be included in the built image. Whennull, the run image bundled with the builder will be used.- Returns:
- the run image
-
setRunImage
Sets the run image that will be included in the built image.- Parameters:
runImage- the run image
-
getEnvironment
Returns the environment that will be used when building the image.- Returns:
- the environment
-
setEnvironment
Sets the environment that will be used when building the image.- Parameters:
environment- the environment
-
environment
Add an entry to the environment that will be used when building the image.- Parameters:
name- the name of the entryvalue- the value of the entry
-
environment
Adds entries to the environment that will be used when building the image.- Parameters:
entries- the entries to add to the environment
-
isCleanCache
@Input public boolean isCleanCache()Returns whether caches should be cleaned before packaging.- Returns:
- whether caches should be cleaned
-
setCleanCache
public void setCleanCache(boolean cleanCache) Sets whether caches should be cleaned before packaging.- Parameters:
cleanCache-trueto clean the cache, otherwisefalse.
-
isVerboseLogging
@Input public boolean isVerboseLogging()Whether verbose logging should be enabled while building the image.- Returns:
- whether verbose logging should be enabled
-
setVerboseLogging
public void setVerboseLogging(boolean verboseLogging) Sets whether verbose logging should be enabled while building the image.- Parameters:
verboseLogging-trueto enable verbose logging, otherwisefalse.
-
getPullPolicy
@Input @Optional public org.springframework.boot.buildpack.platform.build.PullPolicy getPullPolicy()Returns image pull policy that will be used when building the image.- Returns:
- whether images should be pulled
-
setPullPolicy
public void setPullPolicy(org.springframework.boot.buildpack.platform.build.PullPolicy pullPolicy) Sets image pull policy that will be used when building the image.- Parameters:
pullPolicy- image pull policyPullPolicy
-
isPublish
@Input public boolean isPublish()Whether the built image should be pushed to a registry.- Returns:
- whether the built image should be pushed
-
setPublish
public void setPublish(boolean publish) Sets whether the built image should be pushed to a registry.- Parameters:
publish-truethe push the built image to a registry.false.
-
getBuildpacks
Returns the buildpacks that will be used when building the image.- Returns:
- the buildpack references
-
setBuildpacks
Sets the buildpacks that will be used when building the image.- Parameters:
buildpacks- the buildpack references
-
buildpack
Add an entry to the buildpacks that will be used when building the image.- Parameters:
buildpack- the buildpack reference
-
buildpacks
Adds entries to the buildpacks that will be used when building the image.- Parameters:
buildpacks- the buildpack references
-
getBindings
Returns the volume bindings that will be mounted to the container when building the image.- Returns:
- the bindings
-
setBindings
Sets the volume bindings that will be mounted to the container when building the image.- Parameters:
bindings- the bindings
-
binding
Add an entry to the volume bindings that will be mounted to the container when building the image.- Parameters:
binding- the binding
-
bindings
Add entries to the volume bindings that will be mounted to the container when building the image.- Parameters:
bindings- the bindings
-
getTags
Returns the tags that will be created for the built image.- Returns:
- the tags
-
setTags
Sets the tags that will be created for the built image.- Parameters:
tags- the tags
-
tag
Add an entry to the tags that will be created for the built image.- Parameters:
tag- the tag
-
tags
Add entries to the tags that will be created for the built image.- Parameters:
tags- the tags
-
getNetwork
Returns the network the build container will connect to.- Returns:
- the network
-
setNetwork
Sets the network the build container will connect to.- Parameters:
network- the network
-
getBuildCache
Returns the build cache that will be used when building the image.- Returns:
- the cache
-
buildCache
Customizes theCacheSpecfor the build cache using the givenaction.- Parameters:
action- the action
-
getLaunchCache
Returns the launch cache that will be used when building the image.- Returns:
- the cache
-
launchCache
Customizes theCacheSpecfor the launch cache using the givenaction.- Parameters:
action- the action
-
getDocker
Returns the Docker configuration the builder will use.- Returns:
- docker configuration.
- Since:
- 2.4.0
-
docker
Configures the Docker connection using the givenaction.- Parameters:
action- the action to apply- Since:
- 2.4.0
-