Search in sources :

Example 1 with Builder

use of org.springframework.boot.buildpack.platform.build.Builder in project spring-boot by spring-projects.

the class BuildImageMojo method buildImage.

private void buildImage() throws MojoExecutionException {
    Libraries libraries = getLibraries(Collections.emptySet());
    try {
        DockerConfiguration dockerConfiguration = (this.docker != null) ? this.docker.asDockerConfiguration() : null;
        BuildRequest request = getBuildRequest(libraries);
        Builder builder = new Builder(new MojoBuildLog(this::getLog), dockerConfiguration);
        builder.build(request);
    } catch (IOException ex) {
        throw new MojoExecutionException(ex.getMessage(), ex);
    }
}
Also used : DockerConfiguration(org.springframework.boot.buildpack.platform.docker.configuration.DockerConfiguration) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) Builder(org.springframework.boot.buildpack.platform.build.Builder) Libraries(org.springframework.boot.loader.tools.Libraries) IOException(java.io.IOException) BuildRequest(org.springframework.boot.buildpack.platform.build.BuildRequest)

Example 2 with Builder

use of org.springframework.boot.buildpack.platform.build.Builder in project spring-boot by spring-projects.

the class BootBuildImage method buildImage.

@TaskAction
void buildImage() throws DockerEngineException, IOException {
    Builder builder = new Builder(this.docker.asDockerConfiguration());
    BuildRequest request = createRequest();
    builder.build(request);
}
Also used : Builder(org.springframework.boot.buildpack.platform.build.Builder) BuildRequest(org.springframework.boot.buildpack.platform.build.BuildRequest) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

BuildRequest (org.springframework.boot.buildpack.platform.build.BuildRequest)2 Builder (org.springframework.boot.buildpack.platform.build.Builder)2 IOException (java.io.IOException)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 TaskAction (org.gradle.api.tasks.TaskAction)1 DockerConfiguration (org.springframework.boot.buildpack.platform.docker.configuration.DockerConfiguration)1 Libraries (org.springframework.boot.loader.tools.Libraries)1