Skip to content
Merged
Show file tree
Hide file tree
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 @@ -25,8 +25,10 @@ public interface BuildImageCmd extends DockerCmd<BuildImageCmd.Response>{
public boolean hasNoCacheEnabled();

public boolean hasRemoveEnabled();

public boolean isQuiet();

public boolean hasPullEnabled();

public String getPathToDockerfile();

Expand All @@ -50,6 +52,10 @@ public interface BuildImageCmd extends DockerCmd<BuildImageCmd.Response>{

public BuildImageCmd withQuiet(boolean quiet);

public BuildImageCmd withPull();

public BuildImageCmd withPull(boolean pull);

public BuildImageCmd withBuildAuthConfigs(AuthConfigurations authConfig);

public static interface Exec extends DockerCmdExec<BuildImageCmd, BuildImageCmd.Response> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class BuildImageCmdImpl extends AbstrDockerCmd<BuildImageCmd, BuildImageC
private boolean noCache;
private boolean remove = true;
private boolean quiet;
private boolean pull;

private AuthConfigurations buildAuthConfigs;
private File dockerFile;
private File baseDirectory;
Expand Down Expand Up @@ -115,6 +117,11 @@ public boolean hasRemoveEnabled() {
public boolean isQuiet() {
return quiet;
}

@Override
public boolean hasPullEnabled() {
return pull;
}

@Override
public String getPathToDockerfile() {
Expand Down Expand Up @@ -165,6 +172,17 @@ public BuildImageCmdImpl withQuiet(boolean quiet) {
this.quiet = quiet;
return this;
}

@Override
public BuildImageCmdImpl withPull() {
return withPull(true);
}

@Override
public BuildImageCmdImpl withPull(boolean pull) {
this.pull = pull;
return this;
}

@Override
public BuildImageCmd withBuildAuthConfigs(AuthConfigurations authConfigs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ protected ResponseImpl execute(BuildImageCmd command) {
if (command.isQuiet()) {
webResource = webResource.queryParam("q", "true");
}
if (command.hasPullEnabled()) {
webResource = webResource.queryParam("pull", "true");
}
if (dockerFilePath != null && !"Dockerfile".equals(dockerFilePath)) {
webResource = webResource.queryParam("dockerfile", dockerFilePath);
}
Expand Down