Package com.spotify.docker.client.messages

Examples of com.spotify.docker.client.messages.ContainerInfo.state()


  private String createAndStartContainer()
      throws DockerException, InterruptedException {

    // Check if the container is already running
    final ContainerInfo info = getContainerInfo(existingContainerId);
    if (info != null && info.state().running()) {
      return existingContainerId;
    }

    // Ensure we have the image
    final String image = config.containerImage();
View Full Code Here


        return true;
      } catch (DockerException e) {
        log.error("failed to query container {}", containerId, e);
        return false;
      }
      return !containerInfo.state().running();
    }
  }

  private static class Nop implements Command {
View Full Code Here

    //             agent hang forever on waitContainer after the socket got into a weird half-open
    //             state where the kernel (netstat/lsof) would only show one end of the connection
    //             and restarting docker would not close the socket. ¯\_(ツ)_/¯
    while (true) {
      final ContainerInfo info = inspectContainer(containerId);
      if (!info.state().running()) {
        return new ContainerExit(info.state().exitCode());
      }
      Thread.sleep(WAIT_INSPECT_INTERVAL_MILLIS);
    }
  }
View Full Code Here

    //             state where the kernel (netstat/lsof) would only show one end of the connection
    //             and restarting docker would not close the socket. ¯\_(ツ)_/¯
    while (true) {
      final ContainerInfo info = inspectContainer(containerId);
      if (!info.state().running()) {
        return new ContainerExit(info.state().exitCode());
      }
      Thread.sleep(WAIT_INSPECT_INTERVAL_MILLIS);
    }
  }
}
View Full Code Here

      // Wait for container to come up
      Polling.await(5, SECONDS, new Callable<Object>() {
        @Override
        public Object call() throws Exception {
          final ContainerInfo info = docker.inspectContainer(containerId);
          return info.state().running() ? true : null;
        }
      });

      log.info("Verifying that docker containers are reachable");
      try {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.