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, Named, ExtensionAware, Task, Configurable<Task>

@DisableCachingByDefault public abstract class BootBuildImage extends 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
  • Constructor Details

    • BootBuildImage

      public BootBuildImage()
  • Method Details

    • getArchiveFile

      @InputFile @PathSensitive(RELATIVE) public abstract RegularFileProperty getArchiveFile()
      Returns the property for the archive file from which the image will be built.
      Returns:
      the archive file property
    • getImageName

      @Input @Optional public abstract Property<String> getImageName()
      Returns the name of the image that will be built. When null, the name will be derived from the Project's name and version.
      Returns:
      name of the image
    • getBuilder

      @Input @Optional public abstract Property<String> getBuilder()
      Returns the builder that will be used to build the image. When null, the default builder will be used.
      Returns:
      the builder
    • getTrustBuilder

      @Input @Optional public abstract Property<Boolean> getTrustBuilder()
      Whether to treat the builder as trusted.
      Returns:
      whether to trust the builder
      Since:
      3.4.0
    • getRunImage

      @Input @Optional public abstract Property<String> getRunImage()
      Returns the run image that will be included in the built image. When null, the run image bundled with the builder will be used.
      Returns:
      the run image
    • getEnvironment

      @Input public abstract MapProperty<String,String> getEnvironment()
      Returns the environment that will be used when building the image.
      Returns:
      the environment
    • getCleanCache

      @Input public abstract Property<Boolean> getCleanCache()
      Returns whether caches should be cleaned before packaging.
      Returns:
      whether caches should be cleaned
      Since:
      3.0.0
    • getVerboseLogging

      @Input public abstract Property<Boolean> 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

      public void setPullPolicy(String pullPolicy)
      Sets image pull policy that will be used when building the image.
      Parameters:
      pullPolicy - the pull policy to use
    • getPublish

      @Input public abstract Property<Boolean> getPublish()
      Whether the built image should be pushed to a registry.
      Returns:
      whether the built image should be pushed
      Since:
      3.0.0
    • getBuildpacks

      @Input @Optional public abstract ListProperty<String> getBuildpacks()
      Returns the buildpacks that will be used when building the image.
      Returns:
      the buildpack references
    • getBindings

      @Input @Optional public abstract ListProperty<String> getBindings()
      Returns the volume bindings that will be mounted to the container when building the image.
      Returns:
      the bindings
    • getTags

      @Input @Optional public abstract ListProperty<String> getTags()
      Returns the tags that will be created for the built image.
      Returns:
      the tags
    • getNetwork

      @Input @Optional public abstract Property<String> getNetwork()
      Returns the network the build container will connect to.
      Returns:
      the network
    • getBuildWorkspace

      @Optional public CacheSpec getBuildWorkspace()
      Returns the build temporary workspace that will be used when building the image.
      Returns:
      the cache
      Since:
      3.2.0
    • buildWorkspace

      public void buildWorkspace(Action<CacheSpec> action)
      Customizes the CacheSpec for the build temporary workspace using the given action.
      Parameters:
      action - the action
      Since:
      3.2.0
    • getBuildCache

      @Optional public CacheSpec getBuildCache()
      Returns the build cache that will be used when building the image.
      Returns:
      the cache
    • buildCache

      public void buildCache(Action<CacheSpec> action)
      Customizes the CacheSpec for the build cache using the given action.
      Parameters:
      action - the action
    • getLaunchCache

      @Optional public CacheSpec getLaunchCache()
      Returns the launch cache that will be used when building the image.
      Returns:
      the cache
    • launchCache

      public void launchCache(Action<CacheSpec> action)
      Customizes the CacheSpec for the launch cache using the given action.
      Parameters:
      action - the action
    • getCreatedDate

      @Input @Optional public abstract Property<String> getCreatedDate()
      Returns the date that will be used as the Created date of the image. When null, a fixed date that enables build reproducibility will be used.
      Returns:
      the created date
    • getApplicationDirectory

      @Input @Optional public abstract Property<String> getApplicationDirectory()
      Returns the directory that contains application content in the image. When null, a default location will be used.
      Returns:
      the application directory
    • getSecurityOptions

      @Input @Optional public abstract ListProperty<String> getSecurityOptions()
      Returns the security options that will be applied to the builder container.
      Returns:
      the security options
    • getImagePlatform

      @Input @Optional public abstract Property<String> getImagePlatform()
      Returns the platform (os/architecture/variant) that will be used for all pulled images. When null, the system will choose a platform based on the host operating system and architecture.
      Returns:
      the image platform
    • getDocker

      public DockerSpec getDocker()
      Returns the Docker configuration the builder will use.
      Returns:
      docker configuration.
      Since:
      2.4.0
    • docker

      public void docker(Action<DockerSpec> action)
      Configures the Docker connection using the given action.
      Parameters:
      action - the action to apply
      Since:
      2.4.0