diff --git a/src/main/java/com/github/dockerjava/client/command/CreateContainerCmd.java b/src/main/java/com/github/dockerjava/client/command/CreateContainerCmd.java index bf671172f..2947cf68b 100644 --- a/src/main/java/com/github/dockerjava/client/command/CreateContainerCmd.java +++ b/src/main/java/com/github/dockerjava/client/command/CreateContainerCmd.java @@ -63,17 +63,23 @@ public CreateContainerCmd withVolumes(Volume... volumes) { return this; } - public CreateContainerCmd withEnv(String... env) { - Preconditions.checkNotNull(env, "env was not specified"); - this.containerCreateConfig.withEnv(env); - return this; - } - - public CreateContainerCmd withHostName(String hostName) { - Preconditions.checkNotNull(hostName, "hostName was not specified"); - this.containerCreateConfig.withHostName(hostName); - return this; - } + public CreateContainerCmd withVolumesFrom(String... volumesFrom) { + Preconditions.checkNotNull(volumesFrom, "volumes was not specified"); + this.containerCreateConfig.withVolumesFrom(volumesFrom); + return this; + } + + public CreateContainerCmd withEnv(String... env) { + Preconditions.checkNotNull(env, "env was not specified"); + this.containerCreateConfig.withEnv(env); + return this; + } + + public CreateContainerCmd withHostName(String hostName) { + Preconditions.checkNotNull(hostName, "hostName was not specified"); + this.containerCreateConfig.withHostName(hostName); + return this; + } public CreateContainerCmd withName(String name) { Preconditions.checkNotNull(name, "name was not specified"); diff --git a/src/main/java/com/github/dockerjava/client/model/ContainerInspectResponse.java b/src/main/java/com/github/dockerjava/client/model/ContainerInspectResponse.java index 2469f0d8e..7072037cf 100644 --- a/src/main/java/com/github/dockerjava/client/model/ContainerInspectResponse.java +++ b/src/main/java/com/github/dockerjava/client/model/ContainerInspectResponse.java @@ -268,7 +268,7 @@ public class HostConfig { private String dns; @JsonProperty("VolumesFrom") - private String volumesFrom; + private String[] volumesFrom; @JsonProperty("ContainerIDFile") private String containerIDFile; @@ -307,7 +307,7 @@ public String getDns() { return dns; } - public String getVolumesFrom() { + public String[] getVolumesFrom() { return volumesFrom; } diff --git a/src/main/java/com/github/dockerjava/client/model/CreateContainerConfig.java b/src/main/java/com/github/dockerjava/client/model/CreateContainerConfig.java index ab7dbb32d..2ba9c9eb2 100644 --- a/src/main/java/com/github/dockerjava/client/model/CreateContainerConfig.java +++ b/src/main/java/com/github/dockerjava/client/model/CreateContainerConfig.java @@ -58,7 +58,7 @@ public class CreateContainerConfig { @JsonProperty("Dns") private String[] dns; @JsonProperty("Image") private String image; @JsonProperty("Volumes") private Volumes volumes = new Volumes(); - @JsonProperty("VolumesFrom") private String volumesFrom = ""; + @JsonProperty("VolumesFrom") private String[] volumesFrom = new String[]{}; @JsonProperty("WorkingDir") private String workingDir = ""; @JsonProperty("DisableNetwork") private boolean disableNetwork = false; @JsonProperty("ExposedPorts") private ExposedPorts exposedPorts = new ExposedPorts(); @@ -237,11 +237,11 @@ public CreateContainerConfig withVolumes(Volume[] volumes) { return this; } - public String getVolumesFrom() { + public String[] getVolumesFrom() { return volumesFrom; } - public CreateContainerConfig withVolumesFrom(String volumesFrom) { + public CreateContainerConfig withVolumesFrom(String[] volumesFrom) { this.volumesFrom = volumesFrom; return this; }