Package com.bmuschko.gradle.docker.tasks
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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gradle.api.Task
Task.Namer
-
-
Field Summary
-
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
-
-
Constructor Summary
Constructors Constructor Description AbstractDockerRemoteApiTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Property<String>
getApiVersion()
The Docker remote API version.DirectoryProperty
getCertPath()
Path to the Docker certificate and key.com.github.dockerjava.api.DockerClient
getDockerClient()
Gets the Docker client uses to communicate with Docker via its remote API.Property<DockerClientService>
getDockerClientService()
protected Action
getNextHandler()
protected RegistryAuthLocator
getRegistryAuthLocator()
Returns the instance ofRegistryAuthLocator
.Property<String>
getUrl()
Docker remote API server URL.void
onComplete(Runnable callback)
Reacts to the completion of the operation.void
onError(Action<? super Throwable> action)
Reacts to a potential error occurring during the operation.void
onNext(Action action)
Reacts to data returned by an operation.abstract void
runRemoteCommand()
void
start()
-
Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
-
Methods inherited from class org.gradle.api.internal.AbstractTask
appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
-
-
-
Method Detail
-
getUrl
@Input @Optional public final Property<String> getUrl()
Docker remote API server URL. Defaults to "http://localhost:2375".
-
getCertPath
@InputDirectory @PathSensitive(RELATIVE) @Optional public final DirectoryProperty getCertPath()
Path to the Docker certificate and key.
-
getApiVersion
@Input @Optional public final Property<String> getApiVersion()
The Docker remote API version.
-
getDockerClientService
@Internal public final Property<DockerClientService> getDockerClientService()
-
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
-
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:
- The property values of this class
- The plugin's extension property values
It is safe to access the Docker client under the following conditions:
- In the task action
- In the task's constructor if used in
Action
orClosure
ofoutputs.upToDateWhen
- Returns:
- The Docker client
-
getRegistryAuthLocator
@Internal protected RegistryAuthLocator getRegistryAuthLocator()
Returns the instance ofRegistryAuthLocator
.Unless other credentials information provided, the instance returns authConfig object provided by the Docker client.
- Returns:
- The registry authentication locator
-
-