Skip to content

Instantly share code, notes, and snippets.

@ArturSkowronski
Created August 9, 2018 17:16
Show Gist options
  • Save ArturSkowronski/c9c32540b972fa5063b2f491d962b763 to your computer and use it in GitHub Desktop.
Save ArturSkowronski/c9c32540b972fa5063b2f491d962b763 to your computer and use it in GitHub Desktop.
class BuildImageStep
implements AsyncStep<AsyncStep<Image<CachedLayer>>>, Callable<AsyncStep<Image<CachedLayer>>> {
/*(...)*/
private Image<CachedLayer> afterCachedLayersSteps()
throws ExecutionException, LayerPropertyNotFoundException {
try (Timer ignored = new Timer(buildConfiguration.getBuildLogger(), DESCRIPTION)) {
// Constructs the image.
Image.Builder<CachedLayer> imageBuilder = Image.builder();
for (PullAndCacheBaseImageLayerStep pullAndCacheBaseImageLayerStep :
NonBlockingSteps.get(pullAndCacheBaseImageLayersStep)) {
imageBuilder.addLayer(NonBlockingSteps.get(pullAndCacheBaseImageLayerStep));
}
for (BuildAndCacheApplicationLayerStep buildAndCacheApplicationLayerStep :
buildAndCacheApplicationLayerSteps) {
imageBuilder.addLayer(NonBlockingSteps.get(buildAndCacheApplicationLayerStep));
}
imageBuilder.setCreated(buildConfiguration.getCreationTime());
imageBuilder.setEnvironment(buildConfiguration.getEnvironment());
imageBuilder.setEntrypoint(entrypoint);
imageBuilder.setJavaArguments(buildConfiguration.getJavaArguments());
imageBuilder.setExposedPorts(buildConfiguration.getExposedPorts());
// Gets the container configuration content descriptor.
return imageBuilder.build();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment