Search in sources :

Example 1 with DockerContainer

use of io.elastest.epm.client.DockerContainer in project elastest-torm by elastest.

the class PcapService method startPcap.

public Boolean startPcap(String execId) {
    String containerName = containerPrefix + execId;
    if (!containersList.containsKey(containerName)) {
        DockerBuilder dockerBuilder = DockerContainer.dockerBuilder(dockpcapImage, containerName).network(dockpcapNetworkPrefix + execId);
        DockerContainer dockerContainer = dockerBuilder.build();
        containersList.put(containerName, dockerContainer);
        try {
            dockerService.startAndWaitContainer(dockerContainer);
            return true;
        } catch (InterruptedException e) {
            log.error("Pcap not started {}", execId, e);
        }
    }
    return false;
}
Also used : DockerBuilder(io.elastest.epm.client.DockerContainer.DockerBuilder) DockerContainer(io.elastest.epm.client.DockerContainer)

Aggregations

DockerContainer (io.elastest.epm.client.DockerContainer)1 DockerBuilder (io.elastest.epm.client.DockerContainer.DockerBuilder)1