@@ -99,6 +99,8 @@ public class HostConfig {
9999 private Boolean oomKillDisable ;
100100 @ JsonProperty ("OomScoreAdj" )
101101 private Integer oomScoreAdj ;
102+ @ JsonProperty ("AutoRemove" )
103+ private Boolean autoRemove ;
102104
103105 private HostConfig () {
104106 }
@@ -135,6 +137,7 @@ private HostConfig(final Builder builder) {
135137 this .shmSize = builder .shmSize ;
136138 this .oomKillDisable = builder .oomKillDisable ;
137139 this .oomScoreAdj = builder .oomScoreAdj ;
140+ this .autoRemove = builder .autoRemove ;
138141 }
139142
140143 public List <String > binds () {
@@ -257,6 +260,10 @@ public Integer oomScoreAdj() {
257260 return oomScoreAdj ;
258261 }
259262
263+ public Boolean autoRemove () {
264+ return autoRemove ;
265+ }
266+
260267 @ Override
261268 public boolean equals (final Object o ) {
262269 if (this == o ) {
@@ -296,7 +303,8 @@ public boolean equals(final Object o) {
296303 Objects .equals (this .ipcMode , that .ipcMode ) &&
297304 Objects .equals (this .ulimits , that .ulimits ) &&
298305 Objects .equals (this .oomKillDisable , that .oomKillDisable ) &&
299- Objects .equals (this .oomScoreAdj , that .oomScoreAdj );
306+ Objects .equals (this .oomScoreAdj , that .oomScoreAdj ) &&
307+ Objects .equals (this .autoRemove , that .autoRemove );
300308 }
301309
302310 @ Override
@@ -306,7 +314,7 @@ public int hashCode() {
306314 capDrop , networkMode , securityOpt , devices , memory , memorySwap ,
307315 memoryReservation , cpuShares , cpusetCpus , cpuQuota , cgroupParent ,
308316 restartPolicy , logConfig , ipcMode , ulimits , pidMode , shmSize ,
309- oomKillDisable , oomScoreAdj );
317+ oomKillDisable , oomScoreAdj , autoRemove );
310318 }
311319
312320 @ Override
@@ -343,6 +351,7 @@ public String toString() {
343351 .add ("shmSize" , shmSize )
344352 .add ("oomKillDisable" , oomKillDisable )
345353 .add ("oomScoreAdj" , oomScoreAdj )
354+ .add ("autoRemove" , autoRemove )
346355 .toString ();
347356 }
348357
@@ -501,6 +510,7 @@ public static class Builder {
501510 private Long shmSize ;
502511 private Boolean oomKillDisable ;
503512 private Integer oomScoreAdj ;
513+ private Boolean autoRemove ;
504514
505515 private Builder () {
506516 }
@@ -537,6 +547,7 @@ private Builder(final HostConfig hostConfig) {
537547 this .shmSize = hostConfig .shmSize ;
538548 this .oomKillDisable = hostConfig .oomKillDisable ;
539549 this .oomScoreAdj = hostConfig .oomScoreAdj ;
550+ this .autoRemove = hostConfig .autoRemove ;
540551 }
541552
542553 /**
@@ -1042,6 +1053,18 @@ public Integer oomScoreAdj() {
10421053 return oomScoreAdj ;
10431054 }
10441055
1056+ public Boolean autoRemove () {
1057+ return autoRemove ;
1058+ }
1059+
1060+ /**
1061+ * Only works for Docker API version >= 1.25.
1062+ */
1063+ public Builder autoRemove (final Boolean autoRemove ) {
1064+ this .autoRemove = autoRemove ;
1065+ return this ;
1066+ }
1067+
10451068 public HostConfig build () {
10461069 return new HostConfig (this );
10471070 }
0 commit comments