Skip to content

Commit 2d129c3

Browse files
authored
Add MountType.Image and ImageOptions (#2386)
Supported in API v1.48
1 parent 93d1aae commit 2d129c3

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.github.dockerjava.api.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import lombok.EqualsAndHashCode;
5+
import lombok.ToString;
6+
7+
import java.io.Serializable;
8+
9+
/**
10+
* @since {@link RemoteApiVersion#VERSION_1_48}
11+
*/
12+
@EqualsAndHashCode
13+
@ToString
14+
public class ImageOptions extends DockerObject implements Serializable {
15+
private static final long serialVersionUID = 1L;
16+
@JsonProperty("Subpath")
17+
private String subpath;
18+
19+
public String getSubpath() {
20+
return subpath;
21+
}
22+
23+
public ImageOptions withSubpath(String subpath) {
24+
this.subpath = subpath;
25+
return this;
26+
}
27+
}

docker-java-api/src/main/java/com/github/dockerjava/api/model/Mount.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public class Mount extends DockerObject implements Serializable {
5757
@JsonProperty("TmpfsOptions")
5858
private TmpfsOptions tmpfsOptions;
5959

60+
/**
61+
* @since 1.48
62+
*/
63+
@JsonProperty("ImageOptions")
64+
private ImageOptions imageOptions;
65+
6066
/**
6167
* @see #type
6268
*/
@@ -177,4 +183,23 @@ public Mount withTmpfsOptions(TmpfsOptions tmpfsOptions) {
177183
}
178184
return this;
179185
}
186+
187+
/**
188+
* @see #imageOptions
189+
*/
190+
@CheckForNull
191+
public ImageOptions getImageOptions() {
192+
return imageOptions;
193+
}
194+
195+
/**
196+
* @see #imageOptions
197+
*/
198+
public Mount withImageOptions(ImageOptions imageOptions) {
199+
this.imageOptions = imageOptions;
200+
if (imageOptions != null) {
201+
this.type = MountType.IMAGE;
202+
}
203+
return this;
204+
}
180205
}

docker-java-api/src/main/java/com/github/dockerjava/api/model/MountType.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ public enum MountType {
1818

1919
//@since 1.40
2020
@JsonProperty("npipe")
21-
NPIPE
21+
NPIPE,
22+
23+
//@since 1.48
24+
@JsonProperty("image")
25+
IMAGE,
2226

2327
}

0 commit comments

Comments
 (0)