Skip to content

Commit

Permalink
Restructure and polish docker code
Browse files Browse the repository at this point in the history
Restructure and polish docker code to fix a package tangle and
provide better separation of concerns.
  • Loading branch information
philwebb committed Apr 1, 2020
1 parent 5d8d0bb commit 4dad56a
Show file tree
Hide file tree
Showing 34 changed files with 750 additions and 876 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

import org.springframework.boot.buildpack.platform.build.BuilderMetadata.Stack;
import org.springframework.boot.buildpack.platform.docker.DockerApi;
import org.springframework.boot.buildpack.platform.docker.DockerException;
import org.springframework.boot.buildpack.platform.docker.TotalProgressEvent;
import org.springframework.boot.buildpack.platform.docker.TotalProgressPullListener;
import org.springframework.boot.buildpack.platform.docker.UpdateListener;
import org.springframework.boot.buildpack.platform.docker.transport.DockerEngineException;
import org.springframework.boot.buildpack.platform.docker.type.Image;
import org.springframework.boot.buildpack.platform.docker.type.ImageReference;
import org.springframework.util.Assert;
Expand Down Expand Up @@ -56,7 +56,7 @@ public Builder(BuildLog log) {
this.docker = docker;
}

public void build(BuildRequest request) throws DockerException, IOException {
public void build(BuildRequest request) throws DockerEngineException, IOException {
Assert.notNull(request, "Request must not be null");
this.log.start(request);
Image builderImage = pullBuilder(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

import org.apache.http.client.utils.URIBuilder;

import org.springframework.boot.buildpack.platform.docker.Http.Response;
import org.springframework.boot.buildpack.platform.docker.transport.HttpTransport;
import org.springframework.boot.buildpack.platform.docker.transport.HttpTransport.Response;
import org.springframework.boot.buildpack.platform.docker.type.ContainerConfig;
import org.springframework.boot.buildpack.platform.docker.type.ContainerContent;
import org.springframework.boot.buildpack.platform.docker.type.ContainerReference;
Expand All @@ -53,7 +54,7 @@ public class DockerApi {

static final String API_VERSION = "v1.24";

private final Http http;
private final HttpTransport http;

private final JsonStream jsonStream;

Expand All @@ -67,23 +68,23 @@ public class DockerApi {
* Create a new {@link DockerApi} instance.
*/
public DockerApi() {
this(new HttpClientHttp());
this(HttpTransport.create());
}

/**
* Create a new {@link DockerApi} instance backed by a specific {@link HttpClientHttp}
* Create a new {@link DockerApi} instance backed by a specific {@link HttpTransport}
* implementation.
* @param http the http implementation
*/
DockerApi(Http http) {
DockerApi(HttpTransport http) {
this.http = http;
this.jsonStream = new JsonStream(SharedObjectMapper.get());
this.image = new ImageApi();
this.container = new ContainerApi();
this.volume = new VolumeApi();
}

private Http http() {
private HttpTransport http() {
return this.http;
}

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4dad56a

Please sign in to comment.