public class DockerManager extends Object
Constructor and Description |
---|
DockerManager() |
Modifier and Type | Method and Description |
---|---|
void |
addShutdownHook(String containerName) |
void |
destroy(String containerName)
Immediately kill and remove a docker container
|
void |
execCommand(String containerName,
String... command)
Run `docker exec` on a container
|
void |
kill(String containerName)
Immediately kill a docker container.
|
void |
pause(String containerName)
Pause a container from the docker network
|
void |
restart(String containerName)
Restart a docker container
|
void |
resume(String containerName)
Resume a docker container
|
void |
start(String containerName)
Start a docker container
|
void |
stop(String containerName,
Duration timeout)
This method attempts to gracefully stop a container and kill it after timeout.
|
public void stop(String containerName, Duration timeout)
timeout
- a duration after which the stop will kill the containerNodeException
- this exception will be thrown if a container cannot be stopped.public void kill(String containerName)
NodeException
- this exception will be thrown if the container can not be killed.public void destroy(String containerName)
NodeException
- this exception will be thrown if the container can not be killed.public void pause(String containerName)
NodeException
- this exception will be thrown if the container can not be pausedpublic void start(String containerName)
NodeException
- this exception will be thrown if the container can not be startedpublic void restart(String containerName)
NodeException
- this exception will be thrown if the container can not be restartedpublic void resume(String containerName)
NodeException
- this exception will be thrown if the container can not be resumedpublic void execCommand(String containerName, String... command) throws com.spotify.docker.client.exceptions.DockerException, InterruptedException
com.spotify.docker.client.exceptions.DockerException
InterruptedException
public void addShutdownHook(String containerName)
Copyright © 2019 CorfuDB. All rights reserved.