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 TypeMethodDescriptionbooleancom.github.dockerjava.api.DockerClientObtains a rawDockerClientpointing at our docker service endpoint.com.github.dockerjava.api.DockerClientgetClient(int activityTimeoutInSeconds) AsgetClient(), but overriding the defaultreadTimeout.intorg.jenkinsci.plugins.docker.commons.credentials.DockerServerEndpointintCreate a plainSocketto docker API endpointinthashCode()booleanisSwarm()voidsetApiVersion(String apiVersion) voidsetConnectTimeout(int connectTimeout) voidsetHostname(String hostname) voidsetReadTimeout(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 rawDockerClientpointing 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:
DockerClients 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
DockerClientpointing 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
DockerClientpointing at our docker service endpoint.
-
getSocket
Create a plainSocketto docker API endpoint- Returns:
- The
Socketdirect to the docker daemon. - Throws:
IOException- if anything goes wrong.
-
equals
-
hashCode
public int hashCode() -
toString
-