Package io.jenkins.docker.client
Class DockerAPI
- All Implemented Interfaces:
Describable<DockerAPI>
- Author:
- Nicolas De Loof
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
com.github.dockerjava.api.DockerClient
Obtains a rawDockerClient
pointing at our docker service endpoint.com.github.dockerjava.api.DockerClient
getClient
(int activityTimeoutInSeconds) AsgetClient()
, but overriding the defaultreadTimeout
.int
org.jenkinsci.plugins.docker.commons.credentials.DockerServerEndpoint
int
Create a plainSocket
to docker API endpointint
hashCode()
boolean
isSwarm()
void
setApiVersion
(String apiVersion) void
setConnectTimeout
(int connectTimeout) void
setHostname
(String hostname) void
setReadTimeout
(int readTimeout) toString()
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
DockerAPI
@DataBoundConstructor public DockerAPI(org.jenkinsci.plugins.docker.commons.credentials.DockerServerEndpoint dockerHost) -
DockerAPI
-
-
Method Details
-
getDockerHost
public org.jenkinsci.plugins.docker.commons.credentials.DockerServerEndpoint getDockerHost() -
getConnectTimeout
public int getConnectTimeout() -
setConnectTimeout
@DataBoundSetter public void setConnectTimeout(int connectTimeout) -
getReadTimeout
public int getReadTimeout() -
setReadTimeout
@DataBoundSetter public void setReadTimeout(int readTimeout) -
getApiVersion
-
setApiVersion
-
getHostname
-
setHostname
-
isSwarm
public boolean isSwarm() -
getClient
public com.github.dockerjava.api.DockerClient getClient()Obtains a rawDockerClient
pointing at our docker service endpoint. You MUST ensure that you callCloseable.close()
on the returned instance after you are finished with it, otherwise we will leak resources.Note:
DockerClient
s are cached and shared between threads, so taking and releasing is relatively cheap. They're not closed "for real" until they've been unused for some time.- Returns:
- A raw
DockerClient
pointing at our docker service endpoint.
-
getClient
public com.github.dockerjava.api.DockerClient getClient(int activityTimeoutInSeconds) AsgetClient()
, but overriding the defaultreadTimeout
. This is typically used when running long-duration activities that can "go quiet" for a long period of time, e.g. pulling a docker image from a registry or building a docker image. Most users should just callgetClient()
instead.- Parameters:
activityTimeoutInSeconds
- The activity timeout, in seconds. A value less than one means no timeout.- Returns:
- A raw
DockerClient
pointing at our docker service endpoint.
-
getSocket
Create a plainSocket
to docker API endpoint- Returns:
- The
Socket
direct to the docker daemon. - Throws:
IOException
- if anything goes wrong.
-
equals
-
hashCode
public int hashCode() -
toString
-