Class DockerAPI

    • Constructor Detail

      • DockerAPI

        @DataBoundConstructor
        public DockerAPI​(org.jenkinsci.plugins.docker.commons.credentials.DockerServerEndpoint dockerHost)
      • DockerAPI

        public DockerAPI​(org.jenkinsci.plugins.docker.commons.credentials.DockerServerEndpoint dockerHost,
                         int connectTimeout,
                         int readTimeout,
                         String apiVersion,
                         String hostname)
    • Method Detail

      • 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

        public String getApiVersion()
      • setApiVersion

        @DataBoundSetter
        public void setApiVersion​(String apiVersion)
      • getHostname

        public String getHostname()
      • setHostname

        @DataBoundSetter
        public void setHostname​(String hostname)
      • isSwarm

        public boolean isSwarm()
      • getClient

        public com.github.dockerjava.api.DockerClient getClient()
        Obtains a raw DockerClient pointing at our docker service endpoint. You MUST ensure that you call Closeable.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 DockerClient pointing at our docker service endpoint.
      • getClient

        public com.github.dockerjava.api.DockerClient getClient​(int activityTimeoutInSeconds)
        As getClient(), but overriding the default readTimeout. 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 call getClient() 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.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object