use of org.eclipse.linuxtools.docker.core.IDockerProgressHandler in project linuxtools by eclipse.
the class DockerConnection method pullImage.
@Override
public void pullImage(final String imageId, final IRegistryAccount info, final IDockerProgressHandler handler) throws DockerException, InterruptedException, DockerCertificateException {
try {
final DockerClient client = dockerClientFactory.getClient(this.connectionSettings, info);
final DockerProgressHandler d = new DockerProgressHandler(handler);
client.pull(imageId, d);
listImages();
} catch (com.spotify.docker.client.exceptions.DockerRequestException e) {
throw new DockerException(e.message());
} catch (com.spotify.docker.client.exceptions.DockerException e) {
DockerException f = new DockerException(e);
throw f;
}
}
use of org.eclipse.linuxtools.docker.core.IDockerProgressHandler in project linuxtools by eclipse.
the class DockerConnection method buildImage.
@Override
public String buildImage(final IPath path, final IDockerProgressHandler handler) throws DockerException, InterruptedException {
try {
final DockerProgressHandler d = new DockerProgressHandler(handler);
final java.nio.file.Path p = FileSystems.getDefault().getPath(path.makeAbsolute().toOSString());
String res = getClientCopy().build(p, d, // $NON-NLS-1$ //$NON-NLS-2$
BuildParam.create("forcerm", "true"));
return res;
} catch (com.spotify.docker.client.exceptions.DockerRequestException e) {
throw new DockerException(e.message());
} catch (com.spotify.docker.client.exceptions.DockerException | IOException e) {
DockerException f = new DockerException(e);
throw f;
}
}
Aggregations