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
11 changes: 11 additions & 0 deletions src/main/java/com/github/dockerjava/api/command/BuildImageCmd.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
@CheckForNull
Map<String, String> getBuildArgs();

/**
*@since {@link RemoteApiVersion#VERSION_1_22}
*/
@CheckForNull
Long getShmsize();

// setters

BuildImageCmd withTag(String tag);
Expand Down Expand Up @@ -134,6 +140,11 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon

BuildImageCmd withTarInputStream(@Nonnull InputStream tarInputStream);

/**
*@since {@link RemoteApiVersion#VERSION_1_22}
*/
BuildImageCmd withShmsize(Long shmsize);

interface Exec extends DockerCmdAsyncExec<BuildImageCmd, BuildResponseItem> {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public class BuildImageCmdImpl extends AbstrAsyncDockerCmd<BuildImageCmd, BuildR

private Long memswap;

private Long shmsize;

private URI remote;

private Map<String, String> buildArgs;
Expand Down Expand Up @@ -159,6 +161,14 @@ public InputStream getTarInputStream() {
return tarInputStream;
}

/**
* @see #shmsize
*/
@Override
public Long getShmsize() {
return shmsize;
}

// setters

@Override
Expand Down Expand Up @@ -284,6 +294,15 @@ public BuildImageCmd withBuildAuthConfigs(AuthConfigurations authConfigs) {
return this;
}

/**
* @see #shmsize
*/
@Override
public BuildImageCmd withShmsize(Long shmsize) {
this.shmsize = shmsize;
return this;
}

@Override
public void close() {
super.close();
Expand All @@ -294,4 +313,5 @@ public void close() {
throw new RuntimeException(e);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ protected AbstractCallbackNotifier<BuildResponseItem> callbackNotifier(BuildImag
}
}

if (command.getShmsize() != null) {
webTarget = webTarget.queryParam("shmsize", command.getShmsize());
}

webTarget.property(ClientProperties.REQUEST_ENTITY_PROCESSING, RequestEntityProcessing.CHUNKED);
webTarget.property(ClientProperties.CHUNKED_ENCODING_SIZE, 1024 * 1024);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ protected Void execute0(BuildImageCmd command, ResultCallback<BuildResponseItem>
}
}

if (command.getShmsize() != null) {
webTarget = webTarget.queryParam("shmsize", command.getShmsize());
}

LOGGER.trace("POST: {}", webTarget);

InvocationBuilder builder = resourceWithOptionalAuthConfig(command, webTarget.request())
Expand Down