Package org.hortonmachine.modules.docker
Class DockerHandler
- java.lang.Object
-
- org.hortonmachine.modules.docker.DockerHandler
-
public class DockerHandler extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String[]keepAliveCmdstatic StringWORKSPACE
-
Constructor Summary
Constructors Constructor Description DockerHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseClient()voidexecCommand(String command)StringhasImage(String imageName)Checks if a certain image is available.StringinitDocker()Initialize the docker client.voidpullImage(String imageName, String tag, org.hortonmachine.gears.libs.monitor.IHMProgressMonitor pm)voidremoveImage(String imageId)voidstartContainer(String imageName, String volumePath)
-
-
-
Field Detail
-
WORKSPACE
public static final String WORKSPACE
- See Also:
- Constant Field Values
-
keepAliveCmd
public static final String[] keepAliveCmd
-
-
Method Detail
-
hasImage
public String hasImage(String imageName)
Checks if a certain image is available.- Parameters:
imageName- the image to check.- Returns:
- the id of the image or null.
-
removeImage
public void removeImage(String imageId)
-
pullImage
public void pullImage(String imageName, String tag, org.hortonmachine.gears.libs.monitor.IHMProgressMonitor pm) throws Exception
- Throws:
Exception
-
initDocker
public String initDocker()
Initialize the docker client.- Returns:
- an error message if there were issues,
nullif everyhtin gwent smooth.
-
startContainer
public void startContainer(String imageName, String volumePath) throws Exception
- Throws:
Exception
-
-