Package org.eclipse.mosaic.lib.docker
Class DockerClient
java.lang.Object
org.eclipse.mosaic.lib.docker.DockerClient
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Close all containers which has been started by this container.void
killContainer
(DockerContainer container, boolean remove) Kills a container which has been executed by this client.Compose a docker run command by calling this method, building your command, and eventually callingDockerRun.execute()
.
-
Constructor Details
-
DockerClient
public DockerClient()
-
-
Method Details
-
run
Compose a docker run command by calling this method, building your command, and eventually callingDockerRun.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
Kills a container which has been executed by this client.- Parameters:
container
- the container which has been returned previously byrun(String)
remove
-true
, if this container should be removed after being killed
-