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
-
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
-
Method Summary
Modifier and TypeMethodDescriptionThe Docker remote API version.final DirectoryProperty
Path to the Docker certificate and key.com.github.dockerjava.api.DockerClient
Gets the Docker client uses to communicate with Docker via its remote API.final Property<DockerClientService>
protected Action
protected RegistryAuthLocator
Returns the instance ofRegistryAuthLocator
.getUrl()
Docker remote API server URL.void
onComplete
(Runnable callback) Reacts to the completion of the operation.void
Reacts to a potential error occurring during the operation.void
Reacts to data returned by an operation.abstract void
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
-
Constructor Details
-
AbstractDockerRemoteApiTask
public AbstractDockerRemoteApiTask()
-
-
Method Details
-
getUrl
Docker remote API server URL. Defaults to "http://localhost:2375". -
getCertPath
Path to the Docker certificate and key. -
getApiVersion
The Docker remote API version. -
getDockerClientService
-
start
- Throws:
Exception
-
onError
Reacts to a potential error occurring during the operation.- Parameters:
action
- The action handling the error- Since:
- 4.0.0
-
onNext
Reacts to data returned by an operation.- Parameters:
action
- The action handling the data- Since:
- 4.0.0
-
getNextHandler
-
onComplete
Reacts to the completion of the operation.- Parameters:
callback
- The callback to be executed- Since:
- 4.0.0
-
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
Returns the instance ofRegistryAuthLocator
.Unless other credentials information provided, the instance returns authConfig object provided by the Docker client.
- Returns:
- The registry authentication locator
-
runRemoteCommand
- Throws:
Exception
-