Package com.spotify.docker.client.messages

Examples of com.spotify.docker.client.messages.ContainerInfo


  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


    private boolean containerNotRunning()
        throws InterruptedException {
      if (containerId == null) {
        return true;
      }
      final ContainerInfo containerInfo;
      try {
        containerInfo = docker.inspectContainer(containerId);
      } catch (ContainerNotFoundException e) {
        return true;
      } catch (DockerException e) {
        log.error("failed to query container {}", containerId, e);
        return false;
      }
      return !containerInfo.state().running();
    }
View Full Code Here

    // XXX (dano): We're doing this poll loop instead of docker.waitContainer() because we saw the
    //             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

      // 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

Related Classes of com.spotify.docker.client.messages.ContainerInfo

Copyright © 2018 www.massapicom. 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.