Class DockerClient

java.lang.Object
org.eclipse.mosaic.lib.docker.DockerClient

public class DockerClient extends Object
A simple client which is able to run docker images using the command line tools of docker. Note, the command "docker" must be available in $PATH
  • Constructor Details

    • DockerClient

      public DockerClient()
  • Method Details

    • run

      public DockerRun run(String image)
      Compose a docker run command by calling this method, building your command, and eventually calling DockerRun.execute().
      Returns:
      an instance of DockerRun which can be used to compose and execute the docker run command
    • close

      public void close()
      Close all containers which has been started by this container.
    • killContainer

      public void killContainer(DockerContainer container, boolean remove)
      Kills a container which has been executed by this client.
      Parameters:
      container - the container which has been returned previously by run(String)
      remove - true, if this container should be removed after being killed