Source:
protected void pullImage( DockerContainerConfig container, String machineImageName, ProgressMonitor progressMonitor) throws InternalInfrastructureException, SourceNotFoundException { final DockerImageIdentifier dockerImageIdentifier; try { dockerImageIdentifier = DockerImageIdentifierParser.parse(container.getImage()); } catch (DockerFileException e) { throw new InternalInfrastructureException( "Try to build a docker machine source with an invalid location/content. It is not in the expected format", e); } if (dockerImageIdentifier.getRepository() == null) { throw new InternalInfrastructureException( format( "Machine creation failed. Machine source is invalid. No repository is defined. Found '%s'.", dockerImageIdentifier.getRepository())); } DockerMachineSource dockerMachineSource = new DockerMachineSource(dockerImageIdentifier.getRepository()) .withTag(dockerImageIdentifier.getTag()) .withDigest(dockerImageIdentifier.getDigest()) .withRegistry(dockerImageIdentifier.getRegistry()); try { boolean isImageExistLocally = isDockerImageExistLocally(dockerMachineSource.getRepository()); if (doForcePullImage || !isImageExistLocally) { PullParams pullParams = PullParams.create(dockerMachineSource.getRepository()) .withTag(MoreObjects.firstNonNull(dockerMachineSource.getTag(), LATEST_TAG)) .withRegistry(dockerMachineSource.getRegistry()) .withAuthConfigs(dockerCredentials.getCredentials()); docker.pull(pullParams, progressMonitor); } String fullNameOfPulledImage = dockerMachineSource.getLocation(false); try { docker.tag(TagParams.create(fullNameOfPulledImage, machineImageName)); } catch (ImageNotFoundException nfEx) { throw new SourceNotFoundException(nfEx.getLocalizedMessage(), nfEx); } } catch (IOException e) { throw new InternalInfrastructureException( "Can't create machine from image. Cause: " + e.getLocalizedMessage(), e); } }

Target:
protected void pullImage( DockerContainerConfig container, String machineImageName, ProgressMonitor progressMonitor) throws InternalInfrastructureException, SourceNotFoundException { final DockerImageIdentifier dockerImageIdentifier; try { dockerImageIdentifier = DockerImageIdentifierParser.parse(container.getImage()); } catch (DockerFileException e) { throw new InternalInfrastructureException( "Try to build a docker machine source with an invalid location/content. It is not in the expected format", e); } if (dockerImageIdentifier.getRepository() == null) { throw new InternalInfrastructureException( format( "Machine creation failed. Machine source is invalid. No repository is defined. Found '%s'.", dockerImageIdentifier.getRepository())); } try { boolean isImageExistLocally = isDockerImageExistLocally(dockerImageIdentifier.getRepository()); if (doForcePullImage || !isImageExistLocally) { PullParams pullParams = PullParams.create(dockerImageIdentifier.getRepository()) .withTag(MoreObjects.firstNonNull(dockerImageIdentifier.getTag(), LATEST_TAG)) .withRegistry(dockerImageIdentifier.getRegistry()) .withAuthConfigs(dockerCredentials.getCredentials()); docker.pull(pullParams, progressMonitor); } String fullNameOfPulledImage = container.getImage(); try { docker.tag(TagParams.create(fullNameOfPulledImage, machineImageName)); } catch (ImageNotFoundException nfEx) { throw new SourceNotFoundException(nfEx.getLocalizedMessage(), nfEx); } } catch (IOException e) { throw new InternalInfrastructureException( "Can't create machine from image. Cause: " + e.getLocalizedMessage(), e); } }