Class DockerHandler

java.lang.Object
org.hortonmachine.modules.docker.DockerHandler

public class DockerHandler
extends java.lang.Object
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String[] keepAliveCmd  
    static java.lang.String WORKSPACE  
  • Constructor Summary

    Constructors 
    Constructor Description
    DockerHandler()  
  • Method Summary

    Modifier and Type Method Description
    void closeClient()  
    void execCommand​(java.lang.String command)  
    java.lang.String hasImage​(java.lang.String imageName)
    Checks if a certain image is available.
    java.lang.String initDocker()
    Initialize the docker client.
    void pullImage​(java.lang.String imageName, java.lang.String tag, org.hortonmachine.gears.libs.monitor.IHMProgressMonitor pm)  
    void removeImage​(java.lang.String imageId)  
    void startContainer​(java.lang.String imageName, java.lang.String volumePath)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • hasImage

      public java.lang.String hasImage​(java.lang.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​(java.lang.String imageId)
    • pullImage

      public void pullImage​(java.lang.String imageName, java.lang.String tag, org.hortonmachine.gears.libs.monitor.IHMProgressMonitor pm) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • initDocker

      public java.lang.String initDocker()
      Initialize the docker client.
      Returns:
      an error message if there were issues, null if everyhtin gwent smooth.
    • startContainer

      public void startContainer​(java.lang.String imageName, java.lang.String volumePath) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • execCommand

      public void execCommand​(java.lang.String command) throws java.lang.Exception
      Throws:
      java.lang.Exception
    • closeClient

      public void closeClient() throws java.lang.Exception
      Throws:
      java.lang.Exception