@CompileStatic class DockerBuildImage extends AbstractDockerRemoteApiTask implements RegistryCredentialsAware
| Modifiers | Name | Description |
|---|---|---|
class |
DockerBuildImage.1 |
|
class |
DockerBuildImage.2 |
|
class |
DockerBuildImage.3 |
| Type | Name and description |
|---|---|
MapProperty<String, String> |
buildArgsBuild-time variables to pass to the image build. |
SetProperty<String> |
cacheFromImages to consider as cache sources. |
RegularFileProperty |
dockerFileThe Dockerfile to use to build the image. |
SetProperty<String> |
extraHostsBuild-time additional host list to pass to the image build in the format host:ip. |
Property<String> |
imageIdThe ID of the image built. |
RegularFileProperty |
imageIdFileOutput file containing the image ID of the built image. |
SetProperty<String> |
imagesThe images including repository, image name and tag to be built e.g. |
DirectoryProperty |
inputDirInput directory containing the build context. |
MapProperty<String, String> |
labelsLabels to attach as metadata for to the image. |
Property<Long> |
memoryMemory allocated for build specified in bytes (no suffix is needed) |
Property<String> |
networkNetworking mode for the RUN instructions during build. |
Property<Boolean> |
noCacheWhen true, do not use docker cache when building the image. |
Property<String> |
platformThe target platform in the format os[/arch[/variant]], for example linux/s390x or darwin. |
Property<Boolean> |
pullWhen true, always attempt to pull a newer version of the image. |
Property<Boolean> |
quietWhen true, suppress the build output and print image ID on success. |
DockerRegistryCredentials |
registryCredentials{@inheritDoc} |
Property<Boolean> |
removeWhen true, remove intermediate containers after a successful build. |
Property<Long> |
shmSizeSize of /dev/shm in bytes.
|
Property<String> |
targetWith this parameter it is possible to build a special stage in a multi-stage Docker file. |
| Constructor and description |
|---|
DockerBuildImage
() |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
registryCredentials(Action<? super DockerRegistryCredentials> action){@inheritDoc} |
|
void |
runRemoteCommand() |
| Methods inherited from class | Name |
|---|---|
class AbstractDockerRemoteApiTask |
getDockerClient, getNextHandler, getRegistryAuthLocator, onComplete, onError, onNext, runRemoteCommand, start |
Build-time variables to pass to the image build.
The Dockerfile to use to build the image. If null, will use 'Dockerfile' in the build context, i.e. "$inputDir/Dockerfile".
Build-time additional host list to pass to the image build in the format host:ip.
The ID of the image built. The value of this property requires the task action to be executed.
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 '_'.
The images including repository, image name and tag to be built e.g. vieux/apache:2.0.
Input directory containing the build context. Defaults to "$buildDir/docker".
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 {Memory allocated for build specified in bytes (no suffix is needed)
Networking mode for the RUN instructions during build.
When true, do not use docker cache when building the image.
The target platform in the format os[/arch[/variant]], for example linux/s390x or darwin.
When true, always attempt to pull a newer version of the image.
When true, suppress the build output and print image ID on success.
{@inheritDoc}
When true, remove intermediate containers after a successful build.
Size of /dev/shm in bytes.
The size must be greater than 0.
If omitted the system uses 64MB.
Groovy Documentation