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<Task>
,org.gradle.api.internal.DynamicObjectAware
,org.gradle.api.internal.TaskInternal
,ExtensionAware
,Task
,Configurable<Task>
- 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
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
buildCache
(Action<CacheSpec> action) Customizes theCacheSpec
for the build cache using the givenaction
.void
docker
(Action<DockerSpec> action) Configures the Docker connection using the givenaction
.Returns the directory that contains application content in the image.abstract RegularFileProperty
Returns the property for the archive file from which the image will be built.abstract ListProperty<String>
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.abstract ListProperty<String>
Returns the buildpacks that will be used when building the image.Returns whether caches should be cleaned before packaging.Returns the date that will be used as theCreated
date of the image.Returns the Docker configuration the builder will use.abstract MapProperty<String,
String> 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.Whether the built image should be pushed to a registry.Property<org.springframework.boot.buildpack.platform.build.PullPolicy>
Returns image pull policy that will be used when building the image.Returns the run image that will be included in the built image.abstract ListProperty<String>
getTags()
Returns the tags that will be created for the built image.Whether verbose logging should be enabled while building the image.void
launchCache
(Action<CacheSpec> action) Customizes theCacheSpec
for the launch cache using the givenaction
.void
setPullPolicy
(String pullPolicy) Sets image pull policy that will be used when building the 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, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
Methods inherited from class org.gradle.api.internal.AbstractTask
appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Constructor Details
-
BootBuildImage
public BootBuildImage()
-
-
Method Details
-
getArchiveFile
Returns the property for the archive file from which the image will be built.- Returns:
- the archive file property
-
getImageName
Returns the name of the image that will be built. Whennull
, the name will be derived from theProject's
name
andversion
.- Returns:
- 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
-
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
-
getEnvironment
Returns the environment that will be used when building the image.- Returns:
- the environment
-
getCleanCache
Returns whether caches should be cleaned before packaging.- Returns:
- whether caches should be cleaned
- Since:
- 3.0.0
-
getVerboseLogging
Whether verbose logging should be enabled while building the image.- Returns:
- whether verbose logging should be enabled
- Since:
- 3.0.0
-
getPullPolicy
@Input @Optional public Property<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
Sets image pull policy that will be used when building the image.- Parameters:
pullPolicy
- the pull policy to use
-
getPublish
Whether the built image should be pushed to a registry.- Returns:
- whether the built image should be pushed
- Since:
- 3.0.0
-
getBuildpacks
Returns the buildpacks that will be used when building the image.- Returns:
- the buildpack references
-
getBindings
Returns the volume bindings that will be mounted to the container when building the image.- Returns:
- the bindings
-
getTags
Returns the tags that will be created for the built image.- Returns:
- the tags
-
getNetwork
Returns the network the build container will connect to.- Returns:
- the network
-
getBuildCache
Returns the build cache that will be used when building the image.- Returns:
- the cache
-
buildCache
Customizes theCacheSpec
for 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 theCacheSpec
for the launch cache using the givenaction
.- Parameters:
action
- the action
-
getCreatedDate
Returns the date that will be used as theCreated
date of the image. Whennull
, a fixed date that enables build reproducibility will be used.- Returns:
- the created date
-
getApplicationDirectory
Returns the directory that contains application content in the image. Whennull
, a default location will be used.- Returns:
- the application directory
-
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
-