use of com.github.dockerjava.api.command.StartContainerCmd in project camel by apache.
the class DockerProducer method executeStartContainerRequest.
/**
* Produce a start container request
*
* @param client
* @param message
* @return
*/
private StartContainerCmd executeStartContainerRequest(DockerClient client, Message message) {
LOGGER.debug("Executing Docker Start Container Request");
String containerId = DockerHelper.getProperty(DockerConstants.DOCKER_CONTAINER_ID, configuration, message, String.class);
ObjectHelper.notNull(containerId, "Container ID must be specified");
StartContainerCmd startContainerCmd = client.startContainerCmd(containerId);
return startContainerCmd;
}
use of com.github.dockerjava.api.command.StartContainerCmd in project dockerunit by qzagarese.
the class DefaultServiceBuilder method startContainer.
private String startContainer(CreateContainerCmd cmd, DockerClient client) {
CreateContainerResponse createResp = cmd.exec();
StartContainerCmd startCmd = client.startContainerCmd(createResp.getId());
try {
startCmd.exec();
} catch (Throwable t) {
throw new ContainerException(createResp.getId(), t);
}
return startCmd.getContainerId();
}
Aggregations