while (true) { InspectImageResponse iir = cl.inspectImageCmd(img.getId()).exec(); String[] cmd = iir.getContainerConfig().getCmd(); String cmdLine; if (cmd.length == 3 && cmd[0].equals("/bin/sh") && cmd[1].equals("-c")) {
@Restricted(NoExternalUse.class) public DockerTransientNode provisionNode(DockerAPI api, TaskListener listener) throws IOException, Descriptor.FormException, InterruptedException { try { final InspectImageResponse image = pullImage(api, listener); if (StringUtils.isBlank(remoteFs)) { remoteFs = image.getContainerConfig().getWorkingDir(); } if (StringUtils.isBlank(remoteFs)) { remoteFs = "/"; } try(final DockerClient client = api.getClient()) { return doProvisionNode(api, client, listener); } } catch (IOException | Descriptor.FormException | InterruptedException | RuntimeException ex) { final DockerCloud ourCloud = DockerCloud.findCloudForTemplate(this); final long milliseconds = ourCloud == null ? 0L : ourCloud.getEffectiveErrorDurationInMilliseconds(); if (milliseconds > 0L) { // if anything went wrong, disable ourselves for a while final String reason = "Template provisioning failed."; final DockerDisabled reasonForDisablement = getDisabled(); reasonForDisablement.disableBySystem(reason, milliseconds, ex); setDisabled(reasonForDisablement); } throw ex; } }