| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -161,6 +161,14 @@ public class ContainerSpec extends DockerObject implements Serializable { | |||
| 161 | 161 | @JsonProperty("Configs") | |
| 162 | 162 | private List<ContainerSpecConfig> configs; | |
| 163 | 163 | ||
| 164 | + /** | ||
| 165 | + * @since 1.38 | ||
| 166 | + * Run an init inside the container that forwards signals and reaps processes. | ||
| 167 | + * This field is omitted if empty, and the default (as configured on the daemon) is used. | ||
| 168 | + */ | ||
| 169 | + @JsonProperty("Init") | ||
| 170 | + private Boolean init; | ||
| 171 | + | ||
| 164 | 172 | /** | |
| 165 | 173 | * @see #image | |
| 166 | 174 | */ | |
@@ -435,4 +443,13 @@ public ContainerSpec withConfigs(List<ContainerSpecConfig> configs) { | |||
| 435 | 443 | this.configs = configs; | |
| 436 | 444 | return this; | |
| 437 | 445 | } | |
| 446 | + | ||
| 447 | + public Boolean getInit() { | ||
| 448 | + return init; | ||
| 449 | + } | ||
| 450 | + | ||
| 451 | + public ContainerSpec withInit(Boolean init) { | ||
| 452 | + this.init = init; | ||
| 453 | + return this; | ||
| 454 | + } | ||
| 438 | 455 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ public void testUpdateServiceReplicate() throws Exception { | |||
| 27 | 27 | String networkId = dockerClient.createNetworkCmd().withName("networkname").withDriver("overlay") | |
| 28 | 28 | .withIpam(new Network.Ipam().withDriver("default")).exec().getId(); | |
| 29 | 29 | TaskSpec taskSpec = new TaskSpec().withContainerSpec( | |
| 30 | - new ContainerSpec().withImage("busybox").withArgs(Arrays.asList("sleep", "3600"))); | ||
| 30 | + new ContainerSpec().withImage("busybox").withArgs(Arrays.asList("sleep", "3600")).withInit(true)); | ||
| 31 | 31 | ServiceSpec serviceSpec = new ServiceSpec() | |
| 32 | 32 | .withMode(new ServiceModeConfig().withReplicated(new ServiceReplicatedModeOptions().withReplicas(1))) | |
| 33 | 33 | .withTaskTemplate(taskSpec) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments