use of org.springframework.boot.buildpack.platform.docker.type.ContainerConfig in project spring-boot by spring-projects.
the class Lifecycle method run.
private void run(Phase phase) throws IOException {
Consumer<LogUpdateEvent> logConsumer = this.log.runningPhase(this.request, phase.getName());
ContainerConfig containerConfig = ContainerConfig.of(this.builder.getName(), phase::apply);
ContainerReference reference = createContainer(containerConfig);
try {
this.docker.container().start(reference);
this.docker.container().logs(reference, logConsumer::accept);
ContainerStatus status = this.docker.container().wait(reference);
if (status.getStatusCode() != 0) {
throw new BuilderException(phase.getName(), status.getStatusCode());
}
} finally {
this.docker.container().remove(reference, true);
}
}
Aggregations