public class BootBuildImage
extends org.gradle.api.DefaultTask
Task
for bundling an application into an OCI image using a
buildpack.Constructor and Description |
---|
BootBuildImage() |
Modifier and Type | Method and Description |
---|---|
void |
binding(java.lang.String binding)
Add an entry to the volume bindings that will be mounted to the container when
building the image.
|
void |
bindings(java.util.List<java.lang.String> bindings)
Add entries to the volume bindings that will be mounted to the container when
building the image.
|
void |
buildCache(org.gradle.api.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(java.lang.String buildpack)
Add an entry to the buildpacks that will be used when building the image.
|
void |
buildpacks(java.util.List<java.lang.String> buildpacks)
Adds entries to the buildpacks that will be used when building the image.
|
void |
docker(org.gradle.api.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(java.util.Map<java.lang.String,java.lang.String> entries)
Adds entries to the environment that will be used when building the image.
|
void |
environment(java.lang.String name,
java.lang.String value)
Add an entry to the environment that will be used when building the image.
|
org.gradle.api.file.RegularFileProperty |
getArchiveFile()
Returns the property for the archive file from which the image will be built.
|
java.util.List<java.lang.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.
|
java.lang.String |
getBuilder()
Returns the builder that will be used to build the image.
|
java.util.List<java.lang.String> |
getBuildpacks()
Returns the buildpacks that will be used when building the image.
|
DockerSpec |
getDocker()
Returns the Docker configuration the builder will use.
|
java.util.Map<java.lang.String,java.lang.String> |
getEnvironment()
Returns the environment that will be used when building the image.
|
java.lang.String |
getImageName()
Returns the name of the image that will be built.
|
org.gradle.api.file.RegularFileProperty |
getJar()
Deprecated.
since 2.5.0 for removal in 2.7.0 in favor of
getArchiveFile() |
CacheSpec |
getLaunchCache()
Returns the launch cache that will be used when building the image.
|
java.lang.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.
|
java.lang.String |
getRunImage()
Returns the run image that will be included in the built image.
|
java.util.List<java.lang.String> |
getTags()
Returns the tags that will be created for the built image.
|
org.gradle.api.provider.Property<org.gradle.api.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(org.gradle.api.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(java.util.List<java.lang.String> bindings)
Sets the volume bindings that will be mounted to the container when building the
image.
|
void |
setBuilder(java.lang.String builder)
Sets the builder that will be used to build the image.
|
void |
setBuildpacks(java.util.List<java.lang.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(java.util.Map<java.lang.String,java.lang.String> environment)
Sets the environment that will be used when building the image.
|
void |
setImageName(java.lang.String imageName)
Sets the name of the image that will be built.
|
void |
setNetwork(java.lang.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(java.lang.String runImage)
Sets the run image that will be included in the built image.
|
void |
setTags(java.util.List<java.lang.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(java.lang.String tag)
Add an entry to the tags that will be created for the built image.
|
void |
tags(java.util.List<java.lang.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, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
appendParallelSafeAction, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getOnlyIf, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, prependParallelSafeAction, setImpliesSubProjects, setLoggerMessageRewriter
@Input public org.gradle.api.file.RegularFileProperty getArchiveFile()
@Deprecated @Input public org.gradle.api.file.RegularFileProperty getJar()
getArchiveFile()
@Input @Optional public org.gradle.api.provider.Property<org.gradle.api.JavaVersion> getTargetJavaVersion()
targetCompatibility
build property).@Input @Optional public java.lang.String getImageName()
null
, the name will
be derived from the Project's
name
and
version
.public void setImageName(java.lang.String imageName)
imageName
- name of the image@Input @Optional public java.lang.String getBuilder()
null
, the
default builder will be used.public void setBuilder(java.lang.String builder)
builder
- the builder@Input @Optional public java.lang.String getRunImage()
null
,
the run image bundled with the builder will be used.public void setRunImage(java.lang.String runImage)
runImage
- the run image@Input public java.util.Map<java.lang.String,java.lang.String> getEnvironment()
public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
environment
- the environmentpublic void environment(java.lang.String name, java.lang.String value)
name
- the name of the entryvalue
- the value of the entrypublic void environment(java.util.Map<java.lang.String,java.lang.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 java.util.List<java.lang.String> getBuildpacks()
public void setBuildpacks(java.util.List<java.lang.String> buildpacks)
buildpacks
- the buildpack referencespublic void buildpack(java.lang.String buildpack)
buildpack
- the buildpack referencepublic void buildpacks(java.util.List<java.lang.String> buildpacks)
buildpacks
- the buildpack references@Input @Optional public java.util.List<java.lang.String> getBindings()
public void setBindings(java.util.List<java.lang.String> bindings)
bindings
- the bindingspublic void binding(java.lang.String binding)
binding
- the bindingpublic void bindings(java.util.List<java.lang.String> bindings)
bindings
- the bindings@Input @Optional public java.util.List<java.lang.String> getTags()
public void setTags(java.util.List<java.lang.String> tags)
tags
- the tagspublic void tag(java.lang.String tag)
tag
- the tagpublic void tags(java.util.List<java.lang.String> tags)
tags
- the tags@Input @Optional public java.lang.String getNetwork()
public void setNetwork(java.lang.String network)
network
- the network@Optional public CacheSpec getBuildCache()
public void buildCache(org.gradle.api.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(org.gradle.api.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(org.gradle.api.Action<DockerSpec> action)
action
.action
- the action to applypublic void docker(groovy.lang.Closure<?> closure)
closure
.closure
- the closure to apply