Class AbstractDockerRemoteApiTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.bmuschko.gradle.docker.tasks.AbstractDockerRemoteApiTask
All Implemented Interfaces:
Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, Configurable<Task>
Direct Known Subclasses:
DockerBuildImage, DockerCreateNetwork, DockerExistingContainer, DockerExistingImage, DockerExistingNetwork, DockerInfo, DockerInspectExecContainer, DockerListImages, DockerLoadImage, DockerOperation, DockerPullImage, DockerPushImage, DockerSaveImage, DockerVersion

public abstract class AbstractDockerRemoteApiTask extends DefaultTask
  • Constructor Details

    • AbstractDockerRemoteApiTask

      public AbstractDockerRemoteApiTask()
  • Method Details

    • getUrl

      @Input @Optional public final Property<String> getUrl()
      Docker remote API server URL. Defaults to "http://localhost:2375".
    • getCertPath

    • getApiVersion

      @Input @Optional public final Property<String> getApiVersion()
      The Docker remote API version.
    • getDockerClientService

      @Internal public final Property<DockerClientService> getDockerClientService()
    • start

      public void start() throws Exception
      Throws:
      Exception
    • onError

      public void onError(Action<? super Throwable> action)
      Reacts to a potential error occurring during the operation.
      Parameters:
      action - The action handling the error
      Since:
      4.0.0
    • onNext

      public void onNext(Action action)
      Reacts to data returned by an operation.
      Parameters:
      action - The action handling the data
      Since:
      4.0.0
    • getNextHandler

      @Internal protected Action getNextHandler()
    • onComplete

      public void onComplete(Runnable callback)
      Reacts to the completion of the operation.
      Parameters:
      callback - The callback to be executed
      Since:
      4.0.0
    • getDockerClient

      @Internal public com.github.dockerjava.api.DockerClient getDockerClient()
      Gets the Docker client uses to communicate with Docker via its remote API. Initialized instance upon first request. Returns the same instance for any successive method call. To support the configuration cache we rely on DockerClientService's internal cache.

      Before accessing the Docker client, all data used for configuring its runtime behavior needs to be evaluated. The data includes:

      1. The property values of this class
      2. The plugin's extension property values

      It is safe to access the Docker client under the following conditions:

      1. In the task action
      2. In the task's constructor if used in Action or Closure of outputs.upToDateWhen
      Returns:
      The Docker client
    • getRegistryAuthLocator

      @Internal protected RegistryAuthLocator getRegistryAuthLocator()
      Returns the instance of RegistryAuthLocator.

      Unless other credentials information provided, the instance returns authConfig object provided by the Docker client.

      Returns:
      The registry authentication locator
    • runRemoteCommand

      public abstract void runRemoteCommand() throws Exception
      Throws:
      Exception