@CompileStatic class DockerBuildImage extends AbstractDockerRemoteApiTask
Fields inherited from class | Fields |
---|---|
class DefaultTask |
TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION, TASK_CONSTRUCTOR_ARGS |
Type | Name and description |
---|---|
MapProperty<String, String> |
buildArgs Build-time variables to pass to the image build. |
SetProperty<String> |
cacheFrom Images to consider as cache sources. |
RegularFileProperty |
dockerFile The Dockerfile to use to build the image. |
SetProperty<String> |
extraHosts Build-time additional host list to pass to the image build in the format host:ip . |
Property<String> |
imageId The ID of the image built. |
RegularFileProperty |
imageIdFile Output file containing the image ID of the built image. |
SetProperty<String> |
images The images including repository, image name and tag to be built e.g. |
DirectoryProperty |
inputDir Input directory containing the build context. |
MapProperty<String, String> |
labels Labels to attach as metadata for to the image. |
Property<String> |
network Networking mode for the RUN instructions during build. |
Property<Boolean> |
noCache When true , do not use docker cache when building the image. |
Property<Boolean> |
pull When true , always attempt to pull a newer version of the image. |
Property<Boolean> |
quiet When true , suppress the build output and print image ID on success. |
DockerRegistryCredentials |
registryCredentials {@inheritDoc} |
Property<Boolean> |
remove When true , remove intermediate containers after a successful build. |
Property<Long> |
shmSize Size of /dev/shm in bytes.
|
Property<String> |
target With 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() |
Build-time variables to pass to the image build.
Images to consider as cache sources.
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 {
Networking mode for the RUN instructions during build.
When true
, do not use docker cache when building the image.
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.
{@inheritDoc}
Groovy Documentation