Package it.dockins.dockerslaves.spi
Class DockerDriver
java.lang.Object
it.dockins.dockerslaves.spi.DockerDriver
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
CliDockerDriver
Manage Docker resources creation and access so docker-slaves can run a build.
Implementation is responsible to adapt docker infrastructure APIs
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidbuildDockerfile(TaskListener listener, String dockerfilePath, String tag, boolean pull) abstract booleancheckImageExists(TaskListener listener, String image) abstract StringcreateVolume(TaskListener listener) abstract ProcexecInContainer(TaskListener listener, String containerId, Launcher.ProcStarter starter) abstract booleanhasContainer(TaskListener listener, String id) abstract booleanhasVolume(TaskListener listener, String name) abstract ContainerlaunchBuildContainer(TaskListener listener, String image, Container remotingContainer, List<Hint> hints) abstract ContainerlaunchRemotingContainer(TaskListener listener, String image, String workdir, DockerComputer computer) abstract ContainerlaunchSideContainer(TaskListener listener, String image, Container remotingContainer, List<Hint> hints) abstract voidpullImage(TaskListener listener, String image) abstract voidremoveContainer(TaskListener listener, Container instance) abstract StringserverVersion(TaskListener listener) Return server version string, used actually to check connectivity with backend
-
Constructor Details
-
DockerDriver
public DockerDriver()
-
-
Method Details
-
hasVolume
public abstract boolean hasVolume(TaskListener listener, String name) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
createVolume
- Throws:
IOExceptionInterruptedException
-
hasContainer
public abstract boolean hasContainer(TaskListener listener, String id) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
launchRemotingContainer
public abstract Container launchRemotingContainer(TaskListener listener, String image, String workdir, DockerComputer computer) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
launchBuildContainer
public abstract Container launchBuildContainer(TaskListener listener, String image, Container remotingContainer, List<Hint> hints) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
launchSideContainer
public abstract Container launchSideContainer(TaskListener listener, String image, Container remotingContainer, List<Hint> hints) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
execInContainer
public abstract Proc execInContainer(TaskListener listener, String containerId, Launcher.ProcStarter starter) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
removeContainer
public abstract void removeContainer(TaskListener listener, Container instance) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
pullImage
public abstract void pullImage(TaskListener listener, String image) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
checkImageExists
public abstract boolean checkImageExists(TaskListener listener, String image) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
buildDockerfile
public abstract void buildDockerfile(TaskListener listener, String dockerfilePath, String tag, boolean pull) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
serverVersion
public abstract String serverVersion(TaskListener listener) throws IOException, InterruptedException Return server version string, used actually to check connectivity with backend- Throws:
IOExceptionInterruptedException
-