@DisableCachingByDefault public class BootBuildImage extends DefaultTask
Task.Namer
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
Constructor and Description |
---|
BootBuildImage() |
Modifier and Type | Method and Description |
---|---|
void |
binding(String binding)
Add an entry to the volume bindings that will be mounted to the container when
building the image.
|
void |
bindings(List<String> bindings)
Add entries to the volume bindings that will be mounted to the container when
building the image.
|
void |
buildCache(Action<CacheSpec> action)
Customizes the
CacheSpec for the build cache using the given
action . |
void |
buildCache(groovy.lang.Closure<?> closure)
Customizes the
CacheSpec for the build cache using the given
closure . |
void |
buildpack(String buildpack)
Add an entry to the buildpacks that will be used when building the image.
|
void |
buildpacks(List<String> buildpacks)
Adds entries to the buildpacks that will be used when building the image.
|
void |
docker(Action<DockerSpec> action)
Configures the Docker connection using the given
action . |
void |
docker(groovy.lang.Closure<?> closure)
Configures the Docker connection using the given
closure . |
void |
environment(Map<String,String> entries)
Adds entries to the environment that will be used when building the image.
|
void |
environment(String name,
String value)
Add an entry to the environment that will be used when building the image.
|
RegularFileProperty |
getArchiveFile()
Returns the property for the archive file from which the image will be built.
|
List<String> |
getBindings()
Returns the volume bindings that will be mounted to the container when building the
image.
|
CacheSpec |
getBuildCache()
Returns the build cache that will be used when building the image.
|
String |
getBuilder()
Returns the builder that will be used to build the image.
|
List<String> |
getBuildpacks()
Returns the buildpacks that will be used when building the image.
|
DockerSpec |
getDocker()
Returns the Docker configuration the builder will use.
|
Map<String,String> |
getEnvironment()
Returns the environment that will be used when building the image.
|
String |
getImageName()
Returns the name of the image that will be built.
|
CacheSpec |
getLaunchCache()
Returns the launch cache that will be used when building the image.
|
String |
getNetwork()
Returns the network the build container will connect to.
|
org.springframework.boot.buildpack.platform.build.PullPolicy |
getPullPolicy()
Returns image pull policy that will be used when building the image.
|
String |
getRunImage()
Returns the run image that will be included in the built image.
|
List<String> |
getTags()
Returns the tags that will be created for the built image.
|
Property<JavaVersion> |
getTargetJavaVersion()
Returns the target Java version of the project (e.g.
|
boolean |
isCleanCache()
Returns whether caches should be cleaned before packaging.
|
boolean |
isPublish()
Whether the built image should be pushed to a registry.
|
boolean |
isVerboseLogging()
Whether verbose logging should be enabled while building the image.
|
void |
launchCache(Action<CacheSpec> action)
Customizes the
CacheSpec for the launch cache using the given
action . |
void |
launchCache(groovy.lang.Closure<?> closure)
Customizes the
CacheSpec for the launch cache using the given
closure . |
void |
setBindings(List<String> bindings)
Sets the volume bindings that will be mounted to the container when building the
image.
|
void |
setBuilder(String builder)
Sets the builder that will be used to build the image.
|
void |
setBuildpacks(List<String> buildpacks)
Sets the buildpacks that will be used when building the image.
|
void |
setCleanCache(boolean cleanCache)
Sets whether caches should be cleaned before packaging.
|
void |
setEnvironment(Map<String,String> environment)
Sets the environment that will be used when building the image.
|
void |
setImageName(String imageName)
Sets the name of the image that will be built.
|
void |
setNetwork(String network)
Sets the network the build container will connect to.
|
void |
setPublish(boolean publish)
Sets whether the built image should be pushed to a registry.
|
void |
setPullPolicy(org.springframework.boot.buildpack.platform.build.PullPolicy pullPolicy)
Sets image pull policy that will be used when building the image.
|
void |
setRunImage(String runImage)
Sets the run image that will be included in the built image.
|
void |
setTags(List<String> tags)
Sets the tags that will be created for the built image.
|
void |
setVerboseLogging(boolean verboseLogging)
Sets whether verbose logging should be enabled while building the image.
|
void |
tag(String tag)
Add an entry to the tags that will be created for the built image.
|
void |
tags(List<String> tags)
Add entries to the tags that will be created for the built image.
|
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
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
@InputFile @PathSensitive(value=RELATIVE) public RegularFileProperty getArchiveFile()
@Input @Optional public Property<JavaVersion> getTargetJavaVersion()
targetCompatibility
build property).@Input @Optional public String getImageName()
null
, the name will
be derived from the Project's
name
and
version
.public void setImageName(String imageName)
imageName
- name of the image@Input @Optional public String getBuilder()
null
, the
default builder will be used.public void setBuilder(String builder)
builder
- the builder@Input @Optional public String getRunImage()
null
,
the run image bundled with the builder will be used.public void setRunImage(String runImage)
runImage
- the run image@Input public Map<String,String> getEnvironment()
public void setEnvironment(Map<String,String> environment)
environment
- the environmentpublic void environment(String name, String value)
name
- the name of the entryvalue
- the value of the entrypublic void environment(Map<String,String> entries)
entries
- the entries to add to the environment@Input public boolean isCleanCache()
public void setCleanCache(boolean cleanCache)
cleanCache
- true
to clean the cache, otherwise false
.@Input public boolean isVerboseLogging()
public void setVerboseLogging(boolean verboseLogging)
verboseLogging
- true
to enable verbose logging, otherwise
false
.@Input @Optional public org.springframework.boot.buildpack.platform.build.PullPolicy getPullPolicy()
public void setPullPolicy(org.springframework.boot.buildpack.platform.build.PullPolicy pullPolicy)
pullPolicy
- image pull policy PullPolicy
@Input public boolean isPublish()
public void setPublish(boolean publish)
publish
- true
the push the built image to a registry. false
.@Input @Optional public List<String> getBuildpacks()
public void setBuildpacks(List<String> buildpacks)
buildpacks
- the buildpack referencespublic void buildpack(String buildpack)
buildpack
- the buildpack referencepublic void buildpacks(List<String> buildpacks)
buildpacks
- the buildpack references@Input @Optional public List<String> getBindings()
public void setBindings(List<String> bindings)
bindings
- the bindingspublic void binding(String binding)
binding
- the bindingpublic void bindings(List<String> bindings)
bindings
- the bindings@Input @Optional public List<String> getTags()
public void setTags(List<String> tags)
tags
- the tagspublic void tag(String tag)
tag
- the tagpublic void tags(List<String> tags)
tags
- the tags@Input @Optional public String getNetwork()
public void setNetwork(String network)
network
- the network@Optional public CacheSpec getBuildCache()
public void buildCache(Action<CacheSpec> action)
CacheSpec
for the build cache using the given
action
.action
- the actionpublic void buildCache(groovy.lang.Closure<?> closure)
CacheSpec
for the build cache using the given
closure
.closure
- the closure@Optional public CacheSpec getLaunchCache()
public void launchCache(Action<CacheSpec> action)
CacheSpec
for the launch cache using the given
action
.action
- the actionpublic void launchCache(groovy.lang.Closure<?> closure)
CacheSpec
for the launch cache using the given
closure
.closure
- the closurepublic DockerSpec getDocker()
public void docker(Action<DockerSpec> action)
action
.action
- the action to applypublic void docker(groovy.lang.Closure<?> closure)
closure
.closure
- the closure to apply