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 @@ -161,6 +161,14 @@ public class ContainerSpec extends DockerObject implements Serializable {
@JsonProperty("Configs")
private List<ContainerSpecConfig> configs;

/**
* @since 1.38
* Run an init inside the container that forwards signals and reaps processes.
* This field is omitted if empty, and the default (as configured on the daemon) is used.
*/
@JsonProperty("Init")
private Boolean init;

/**
* @see #image
*/
Expand Down Expand Up @@ -435,4 +443,13 @@ public ContainerSpec withConfigs(List<ContainerSpecConfig> configs) {
this.configs = configs;
return this;
}

public Boolean getInit() {
return init;
}

public ContainerSpec withInit(Boolean init) {
this.init = init;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void testUpdateServiceReplicate() throws Exception {
String networkId = dockerClient.createNetworkCmd().withName("networkname").withDriver("overlay")
.withIpam(new Network.Ipam().withDriver("default")).exec().getId();
TaskSpec taskSpec = new TaskSpec().withContainerSpec(
new ContainerSpec().withImage("busybox").withArgs(Arrays.asList("sleep", "3600")));
new ContainerSpec().withImage("busybox").withArgs(Arrays.asList("sleep", "3600")).withInit(true));
ServiceSpec serviceSpec = new ServiceSpec()
.withMode(new ServiceModeConfig().withReplicated(new ServiceReplicatedModeOptions().withReplicas(1)))
.withTaskTemplate(taskSpec)
Expand Down