public class DockerCloud
extends hudson.slaves.Cloud
DockerTemplate contains configuration for running docker image.| Modifier and Type | Class and Description |
|---|---|
static class |
DockerCloud.DescriptorImpl |
| Modifier and Type | Field and Description |
|---|---|
String |
credentialsId
Deprecated.
|
String |
dockerHostname |
int |
readTimeout |
String |
version |
| Constructor and Description |
|---|
DockerCloud(String name,
List<? extends DockerTemplate> templates,
org.jenkinsci.plugins.docker.commons.credentials.DockerServerEndpoint dockerHost,
int containerCap,
int connectTimeout,
int readTimeout,
String version,
String dockerHostname) |
DockerCloud(String name,
List<? extends DockerTemplate> templates,
String serverUrl,
int containerCap,
int connectTimeout,
int readTimeout,
String credentialsId,
String version,
String dockerHostname)
Deprecated.
|
DockerCloud(String name,
List<? extends DockerTemplate> templates,
String serverUrl,
String containerCapStr,
int connectTimeout,
int readTimeout,
String credentialsId,
String version,
String dockerHostname)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addJobTemplate(long jobId,
DockerTemplate template)
Adds a template which is temporary provided and bound to a specific job.
|
void |
addTemplate(DockerTemplate t)
Add a new template to the cloud
|
boolean |
canProvision(hudson.model.Label label) |
int |
countCurrentDockerSlaves(String imageName)
Counts the number of instances in Docker currently running that are using the specified image.
|
boolean |
equals(Object o) |
com.github.dockerjava.api.DockerClient |
getClient()
Connects to Docker.
|
static DockerCloud |
getCloudByName(String name) |
int |
getConnectTimeout() |
int |
getContainerCap() |
String |
getContainerCapStr()
Deprecated.
|
org.jenkinsci.plugins.docker.commons.credentials.DockerServerEndpoint |
getDockerHost() |
String |
getDockerHostname() |
String |
getServerUrl()
Deprecated.
|
DockerTemplate |
getTemplate(hudson.model.Label label)
Gets first
DockerTemplate that has the matching Label. |
DockerTemplate |
getTemplate(String template) |
List<DockerTemplate> |
getTemplates() |
List<DockerTemplate> |
getTemplates(hudson.model.Label label)
Multiple amis can have the same label.
|
boolean |
isExposeDockerHost() |
boolean |
isTriton() |
Collection<hudson.slaves.NodeProvisioner.PlannedNode> |
provision(hudson.model.Label label,
int excessWorkload) |
Object |
readResolve() |
void |
removeJobTemplate(long jobId)
Removes a template which is bound to a specific job.
|
void |
removeTemplate(DockerTemplate t)
Remove Docker template
|
static String |
runContainer(DockerTemplateBase dockerTemplateBase,
com.github.dockerjava.api.DockerClient dockerClient,
DockerComputerLauncher launcher)
for publishers/builders.
|
protected String |
sanitizeUrl(String url) |
void |
setContainerCap(int containerCap) |
void |
setExposeDockerHost(boolean exposeDockerHost) |
protected boolean |
shouldPullImage(String imageName,
DockerImagePullStrategy pullStrategy) |
String |
toString() |
all, checkPermission, getACL, getDescriptor, getDisplayName, getSearchUrl, hasPermission@Deprecated public transient String credentialsId
public final int readTimeout
public final String version
public final String dockerHostname
@DataBoundConstructor public DockerCloud(String name, List<? extends DockerTemplate> templates, org.jenkinsci.plugins.docker.commons.credentials.DockerServerEndpoint dockerHost, int containerCap, int connectTimeout, int readTimeout, String version, String dockerHostname)
@Deprecated public DockerCloud(String name, List<? extends DockerTemplate> templates, String serverUrl, int containerCap, int connectTimeout, int readTimeout, String credentialsId, String version, String dockerHostname)
@Deprecated public DockerCloud(String name, List<? extends DockerTemplate> templates, String serverUrl, String containerCapStr, int connectTimeout, int readTimeout, String credentialsId, String version, String dockerHostname)
public int getConnectTimeout()
public org.jenkinsci.plugins.docker.commons.credentials.DockerServerEndpoint getDockerHost()
@Deprecated public String getServerUrl()
public String getDockerHostname()
@Deprecated public String getContainerCapStr()
getContainerCap()public int getContainerCap()
public void setContainerCap(int containerCap)
public com.github.dockerjava.api.DockerClient getClient()
public Collection<hudson.slaves.NodeProvisioner.PlannedNode> provision(hudson.model.Label label, int excessWorkload)
provision in class hudson.slaves.Cloudpublic static String runContainer(DockerTemplateBase dockerTemplateBase, com.github.dockerjava.api.DockerClient dockerClient, DockerComputerLauncher launcher)
protected boolean shouldPullImage(String imageName, DockerImagePullStrategy pullStrategy)
public boolean canProvision(hudson.model.Label label)
canProvision in class hudson.slaves.Cloud@CheckForNull public DockerTemplate getTemplate(String template)
@CheckForNull public DockerTemplate getTemplate(hudson.model.Label label)
DockerTemplate that has the matching Label.public void addTemplate(DockerTemplate t)
public void addJobTemplate(long jobId,
DockerTemplate template)
jobId - Unique id (per master) of the job to which the template is bound.template - The template to bound to a specific job.public void removeJobTemplate(long jobId)
jobId - Id of the job.public List<DockerTemplate> getTemplates()
public List<DockerTemplate> getTemplates(hudson.model.Label label)
public void removeTemplate(DockerTemplate t)
public int countCurrentDockerSlaves(String imageName) throws Exception
imageName - If null, then all instances are counted.
This includes those instances that may be started outside Hudson.Exceptionpublic static DockerCloud getCloudByName(String name)
public Object readResolve()
public boolean isTriton()
public boolean isExposeDockerHost()
@DataBoundSetter public void setExposeDockerHost(boolean exposeDockerHost)
Copyright © 2016–2017. All rights reserved.