code: private DockerSlave provisionWithWait(DockerSlaveTemplate template, ProvisioningActivity.Id id)
              throws Exception {
          final DockerContainerLifecycle dockerContainerLifecycle = template.getDockerContainerLifecycle();
          final String imageId = dockerContainerLifecycle.getImage();
          final DockerComputerLauncher computerLauncher = template.getLauncher();
  
          //pull image
          dockerContainerLifecycle.getPullImage().exec(getClient(), imageId, new StreamTaskListener(new NullStream()));
  
          // set the operating system if it's not already cached
          if (template.getOsType() == null) {
              template.setOsType(determineOsType(imageId));
          }
  
          LOG.debug("Trying to run container for {}, operating system {}", imageId, template.getOsType());
          final String containerId = runContainer(template);
  
          InspectContainerResponse ir;
          try {
              ir = getClient().inspectContainerCmd(containerId).exec();
          } catch (ProcessingException ex) {
              LOG.error("Failed to run container for {}, clean-up container", imageId);
              dockerContainerLifecycle.getRemoveContainer().exec(getClient(), containerId);
              throw ex;
          }
  
          // Build a description up:
          String nodeDescription = "Docker Node [" + imageId + " on ";
          try {
              nodeDescription += getDisplayName();
          } catch (Exception ex) {
              nodeDescription += "???";
          }
          nodeDescription += "]";
  
          String slaveName = String.format("%s-%s", getDisplayName(), containerId.substring(0, 12));
  
          if (computerLauncher.waitUp(getDisplayName(), template, ir)) {
              LOG.debug("Container {} is ready for slave connection", containerId);
          } else {
              LOG.error("Container {} is not ready for slave connection.", containerId);
          }
  
          final DockerComputerLauncher launcher = computerLauncher.getPreparedLauncher(getDisplayName(), template, ir);
          return new DockerSlave(slaveName, nodeDescription, launcher, containerId, template, getDisplayName(), id);
      }
docs: Provision slave container and wait for it's availability.