use of com.google.cloud.tools.jib.image.ImageTarball in project jib by google.
the class LoadDockerStep method call.
@Override
public BuildResult call() throws InterruptedException, IOException {
EventHandlers eventHandlers = buildContext.getEventHandlers();
try (TimerEventDispatcher ignored = new TimerEventDispatcher(eventHandlers, "Loading to Docker daemon")) {
eventHandlers.dispatch(LogEvent.progress("Loading to Docker daemon..."));
ImageTarball imageTarball = new ImageTarball(builtImage, buildContext.getTargetImageConfiguration().getImage(), buildContext.getAllTargetImageTags());
// See https://github.com/GoogleContainerTools/jib/pull/1960#discussion_r321898390
try (ProgressEventDispatcher progressEventDispatcher = progressEventDispatcherFactory.create("loading to Docker daemon", imageTarball.getTotalLayerSize());
ThrottledAccumulatingConsumer throttledProgressReporter = new ThrottledAccumulatingConsumer(progressEventDispatcher::dispatchProgress)) {
// Load the image to docker daemon.
eventHandlers.dispatch(LogEvent.debug(dockerClient.load(imageTarball, throttledProgressReporter)));
return BuildResult.fromImage(builtImage, buildContext.getTargetFormat());
}
}
}
use of com.google.cloud.tools.jib.image.ImageTarball in project jib by GoogleContainerTools.
the class LoadDockerStep method call.
@Override
public BuildResult call() throws InterruptedException, IOException {
EventHandlers eventHandlers = buildContext.getEventHandlers();
try (TimerEventDispatcher ignored = new TimerEventDispatcher(eventHandlers, "Loading to Docker daemon")) {
eventHandlers.dispatch(LogEvent.progress("Loading to Docker daemon..."));
ImageTarball imageTarball = new ImageTarball(builtImage, buildContext.getTargetImageConfiguration().getImage(), buildContext.getAllTargetImageTags());
// See https://github.com/GoogleContainerTools/jib/pull/1960#discussion_r321898390
try (ProgressEventDispatcher progressEventDispatcher = progressEventDispatcherFactory.create("loading to Docker daemon", imageTarball.getTotalLayerSize());
ThrottledAccumulatingConsumer throttledProgressReporter = new ThrottledAccumulatingConsumer(progressEventDispatcher::dispatchProgress)) {
// Load the image to docker daemon.
eventHandlers.dispatch(LogEvent.debug(dockerClient.load(imageTarball, throttledProgressReporter)));
return BuildResult.fromImage(builtImage, buildContext.getTargetFormat());
}
}
}
Aggregations