File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
docker-java-api/src/main/java/com/github/dockerjava/api/model
docker-java/src/test/java/com/github/dockerjava/cmd/swarm Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,14 @@ public class ContainerSpec extends DockerObject implements Serializable {
161161 @ JsonProperty ("Configs" )
162162 private List <ContainerSpecConfig > configs ;
163163
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+
164172 /**
165173 * @see #image
166174 */
@@ -435,4 +443,13 @@ public ContainerSpec withConfigs(List<ContainerSpecConfig> configs) {
435443 this .configs = configs ;
436444 return this ;
437445 }
446+
447+ public Boolean getInit () {
448+ return init ;
449+ }
450+
451+ public ContainerSpec withInit (Boolean init ) {
452+ this .init = init ;
453+ return this ;
454+ }
438455}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public void testUpdateServiceReplicate() throws Exception {
2727 String networkId = dockerClient .createNetworkCmd ().withName ("networkname" ).withDriver ("overlay" )
2828 .withIpam (new Network .Ipam ().withDriver ("default" )).exec ().getId ();
2929 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 ) );
3131 ServiceSpec serviceSpec = new ServiceSpec ()
3232 .withMode (new ServiceModeConfig ().withReplicated (new ServiceReplicatedModeOptions ().withReplicas (1 )))
3333 .withTaskTemplate (taskSpec )
You can’t perform that action at this time.
0 commit comments