Class DockerBuildImage

    • Constructor Detail

      • DockerBuildImage

        public DockerBuildImage()
    • Method Detail

      • getImages

        @Input
        @Optional
        public final SetProperty<String> getImages()
        The images including repository, image name and tag to be built e.g. vieux/apache:2.0.
        Since:
        6.0.0
      • getLabels

        @Input
        @Optional
        public MapProperty<String,​String> getLabels()
        Labels to attach as metadata for to the image.

        This property is not final to allow build authors to remove the labels from the up-to-date check by extending DockerBuildImage and annotating the overrided getLabels() method with @Internal, example:

         import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
        
         class CustomDockerBuildImage extends DockerBuildImage {
            @Override
            @Internal
             MapProperty<String, String> getLabels() {
                 super.getLabels()
             }
         }
         

        A use case for excluding the labels from the up-to-date check is if build author wants to set build information as labels (date, version-control-revision).

      • getShmSize

        @Input
        @Optional
        public final Property<Long> getShmSize()
        Size of /dev/shm in bytes. The size must be greater than 0. If omitted the system uses 64MB.
      • getMemory

        @Input
        @Optional
        public final Property<Long> getMemory()
        Memory allocated for build specified in bytes (no suffix is needed)
        Since:
        7.3.0
      • getTarget

        @Input
        @Optional
        public final Property<String> getTarget()
        With this parameter it is possible to build a special stage in a multi-stage Docker file.

        This feature is only available for use with Docker 17.05 and higher.

        Since:
        4.10.0
      • getExtraHosts

        @Input
        @Optional
        public final SetProperty<String> getExtraHosts()
        Build-time additional host list to pass to the image build in the format host:ip.
        Since:
        6.2.0
      • getPlatform

        @Input
        @Optional
        public final Property<String> getPlatform()
        The target platform in the format os[/arch[/variant]], for example linux/s390x or darwin.
        Since:
        7.1.0
      • getImageIdFile

        @OutputFile
        public final RegularFileProperty getImageIdFile()
        Output file containing the image ID of the built image. Defaults to "$buildDir/.docker/$taskpath-imageId.txt". If path contains ':' it will be replaced by '_'.
        Since:
        4.9.0
      • getImageId

        @Internal
        public final Property<String> getImageId()
        The ID of the image built. The value of this property requires the task action to be executed.