예제 #1
0
 @Override
 public MachineRuntimeInfoImpl getRuntime() {
   if (machineRuntime == null) {
     try {
       final ContainerInfo containerInfo = docker.inspectContainer(container);
       machineRuntime =
           new MachineRuntimeInfoImpl(
               dockerMachineFactory.createMetadata(containerInfo, node.getHost()));
     } catch (IOException e) {
       LOG.error(e.getLocalizedMessage(), e);
       return null;
     }
   }
   return machineRuntime;
 }
예제 #2
0
  @Override
  public void destroy() throws MachineException {
    machineProcesses.clear();
    processesCleaner.untrackProcesses(getId());
    dockerInstanceStopDetector.stopDetection(container);
    try {
      if (getConfig().isDev()) {
        node.unbindWorkspace();
      }

      docker.killContainer(container);

      docker.removeContainer(container, true, true);
    } catch (IOException e) {
      throw new MachineException(e.getLocalizedMessage());
    }

    try {
      docker.removeImage(image, false);
    } catch (IOException ignore) {
    }
  }