Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class BuildImgCmd extends AbstrDockerCmd<BuildImgCmd, ClientResponse> {
private InputStream tarInputStream = null;
private String tag;
private boolean noCache;
private boolean remove = true;
private boolean quiet;


public BuildImgCmd(File dockerFolder) {
Expand All @@ -68,11 +70,23 @@ public BuildImgCmd withNoCache(boolean noCache) {
return this;
}

public BuildImgCmd withRemove(boolean rm) {
this.remove = rm;
return this;
}

public BuildImgCmd withQuiet(boolean quiet) {
this.quiet = quiet;
return this;
}

@Override
public String toString() {
return new StringBuilder("build ")
.append(tag != null ? "-t " + tag + " " : "")
.append(noCache ? "--nocache=true " : "")
.append(quiet ? "--quiet=true " : "")
.append(!remove ? "--rm=false " : "")
.append(dockerFolder != null ? dockerFolder.getPath() : "-")
.toString();
}
Expand All @@ -98,6 +112,12 @@ protected ClientResponse callDocker(final InputStream dockerFolderTarInputStream
if (noCache) {
params.add("nocache", "true");
}
if (remove) {
params.add("rm", "true");
}
if (quiet) {
params.add("q", "true");
}

WebResource webResource = baseResource.path("/build").queryParams(params);

Expand Down