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 @@ -1006,6 +1006,11 @@ default CreateContainerCmd withUlimits(List<Ulimit> ulimits) {
return this;
}

@CheckForNull
String getPlatform();

CreateContainerCmd withPlatform(String platform);

/**
* @throws NotFoundException No such container
* @throws ConflictException Named container already exists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ public class CreateContainerCmdImpl extends AbstrDockerCmd<CreateContainerCmd, C

private AuthConfig authConfig;

private String platform;

public CreateContainerCmdImpl(CreateContainerCmd.Exec exec, AuthConfig authConfig, String image) {
super(exec);
withAuthConfig(authConfig);
Expand Down Expand Up @@ -553,6 +555,18 @@ public CreateContainerCmdImpl withOnBuild(List<String> onBuild) {
return this;
}

@CheckForNull
@Override
public String getPlatform() {
return platform;
}

@Override
public CreateContainerCmd withPlatform(String platform) {
this.platform = platform;
return this;
}

/**
* @throws NotFoundException No such container
* @throws ConflictException Named container already exists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ protected CreateContainerResponse execute(CreateContainerCmd command) {
webResource = webResource.queryParam("name", command.getName());
}

if (command.getPlatform() != null) {
webResource = webResource.queryParam("platform", command.getPlatform());
}

LOGGER.trace("POST: {} ", webResource);
return resourceWithOptionalAuthConfig(command.getAuthConfig(), webResource.request())
.accept(MediaType.APPLICATION_JSON)
Expand Down