diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8f76b34dd..96a1b9d6e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,87 @@
Change Log
===
+
+
+## 3.1.2
+- update unix-socket to 2.2.0
+- Remove `JacksonJaxbJsonProvider` from `FiltersEncoder`
+- BuildImageCmdImpl: Fix an exception message
+- Add support for target parameter in BuildImgCmd
+- Add prune operations
+- Updating Jackson due to CVEs
+- Make StatsConfig public
+- Set 3 mb as limit for json responce.
+
+## 3.1.1
+- Patch save image with tag
+- [api/healthcheck] startPeriod is now a long
+
+## 3.1.0
+- Release
+
+## 3.1.0-rc-8
+- Do awaitCompletion upon socket close exception
+- Fix `X-Registry-Auth` base64 encoding
+
+## 3.1.0-rc-7
+- Fix NPE when docker config file doesn't exist
+
+## 3.1.0-rc-6
+- Add resize feature to container and exec
+- Update part of apis to 1.37
+- Update dependencies
+- Fix No serializer found for class com.githubdockerjava.api.model.ServiceGlobalModeOptions
+- Add HostConfig.StorageOpt and ExecCreateCmd.Env
+- Added GCPLOGS enum LoggingType
+- Stop proxying HostConfig class (static helper provided)
+- Add ExecCreateCmd.Env
+- Add failcnt into memorystatsconfig
+- Support some missing Engine APIs
+- Added memory swappiness to create container command.
+- Fix for ignore all files except specified
+
+## 3.1.0-rc-5
+- Add missing properties in InspectContainer response
+- Add withFilter methods in ListNetworksCmd & ListVolumesCmd
+- Add WorkingDir property in containers exec
+- Add isolation property support in Info response
+- Support platform option in image build/create/pull commands
+- Add OSVersion and RootFS support in InspectImageResponse
+- Fix double-marshalling of cachefrom
+- make AuthConfig compatible with indentitytoken
+- Allow netty to handle compressed response bodies
+
+## 3.1.0-rc-4
+- Update deps
+- fix HTTP/1.1 compliance (missing Host header)
+- support rollback_completed value in ServiceUpdateState
+- Add Privileged property to ExecCreateCmd
+- Encode spaces as %20 rather than + in URL params
+- Add tmpfs mount support since v1.29
+- Add support for swarm service/task logs
+- Add mapping annotations to custom constructor
+- Support network mode as part of the docker build
+- support "rollback" as value for UpdateFailureAction
+- Add "Pid" field to InspectExecResponse
+- Add DiskQuota to HostConfig and CreateContainerCmd
+- Add AutoRemove to HostConfig
+- follow symbolic links when walking dir
+- Use path from the configured docker host instead of hardcoded "/var/run/docker.sock" in netty factory
+- Configure JerseyDockerCmdExecFactory to avoid chunked encoding
+
+## 3.1.0-rc-3
+- export TmpFs configuration for HostConfig and DockerClient
+- avoid double encoding for url query string
+
+## 3.1.0-rc-2
+- https://github.com/docker-java/docker-java/pulls?q=is%3Apr+milestone%3A3.1.0-rc-2+is%3Aclosed
+
## 3.1.0-rc-1
A lot of changes...
- Swarm Mode support.
- Classic swarm support.
- various netty improvements
+- Implement AbstractDockerCmdExecFactory
## 3.0.14
diff --git a/README.md b/README.md
index c3dc39825..de96156a5 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ For secure tls (https) communication:
DOCKER_CERT_PATH=/Users/marcus/.docker/machine/machines/docker-1.11.2
### Latest release version
-Supports a subset of the Docker Remote API [v1.23](https://github.com/docker/docker/blob/master/docs/api/v1.23.md), Docker Server version 1.11.x
+Supports a subset of the Docker Remote API [v1.37](https://docs.docker.com/engine/api/v1.37/), Docker Server version since 1.12.6
com.github.docker-java
@@ -62,7 +62,7 @@ Supports a subset of the Docker Remote API [v1.23](https://github.com/docker/doc
### Latest development version
-Supports a subset of the Docker Remote API [v1.23](https://github.com/docker/docker/blob/master/docs/api/v1.23.md), Docker Server version 1.11.x
+May contain new features while they are not released.
You can find the latest development version including javadoc and source files on [Sonatypes OSS repository](https://oss.sonatype.org/content/groups/public/com/github/docker-java/docker-java/).
@@ -101,7 +101,7 @@ In your application, e.g.
.withDockerTlsVerify(true)
.withDockerCertPath("/home/user/.docker/certs")
.withDockerConfig("/home/user/.docker")
- .withApiVersion("1.23")
+ .withApiVersion("1.30") // optional
.withRegistryUrl("https://index.docker.io/v1/")
.withRegistryUsername("dockeruser")
.withRegistryPassword("ilovedocker")
diff --git a/pom.xml b/pom.xml
index 25e75bebd..0a663d046 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
com.github.docker-javadocker-javabundle
- 3.1.0-rc-4
+ 3.1.4docker-javahttps://github.com/docker-java/docker-java
@@ -28,7 +28,7 @@
scm:git:git@github.com:docker-java/docker-java.gitgit@github.com:docker-java/docker-java.gitscm:git:git@github.com:docker-java/docker-java.git
- 3.1.0-rc-4
+ 3.1.4
@@ -58,21 +58,21 @@
1.72.27
- 2.6.7
+ 2.9.84.5.6
- 1.17
+ 1.181.112.62.61.7.251.60
- 2.0.4
+ 2.2.019.01.2.3
- 4.1.27.Final
+ 4.1.31.Final1.31.82.3.3
@@ -164,7 +164,7 @@
org.slf4jjcl-over-slf4j
- 1.7.21
+ ${slf4j-api.version}
@@ -512,7 +512,7 @@
org.codehaus.mojofindbugs-maven-plugin
- 3.0.3
+ 3.0.5MaxLow
diff --git a/src/main/java/com/github/dockerjava/api/DockerClient.java b/src/main/java/com/github/dockerjava/api/DockerClient.java
index 24ed54dcf..ddc23dca8 100644
--- a/src/main/java/com/github/dockerjava/api/DockerClient.java
+++ b/src/main/java/com/github/dockerjava/api/DockerClient.java
@@ -42,6 +42,7 @@
import com.github.dockerjava.api.command.LogSwarmObjectCmd;
import com.github.dockerjava.api.command.PauseContainerCmd;
import com.github.dockerjava.api.command.PingCmd;
+import com.github.dockerjava.api.command.PruneCmd;
import com.github.dockerjava.api.command.PullImageCmd;
import com.github.dockerjava.api.command.PushImageCmd;
import com.github.dockerjava.api.command.RemoveContainerCmd;
@@ -68,6 +69,7 @@
import com.github.dockerjava.api.exception.DockerException;
import com.github.dockerjava.api.model.AuthConfig;
import com.github.dockerjava.api.model.Identifier;
+import com.github.dockerjava.api.model.PruneType;
import com.github.dockerjava.api.model.ServiceSpec;
import com.github.dockerjava.api.model.SwarmSpec;
import com.github.dockerjava.core.RemoteApiVersion;
@@ -391,6 +393,13 @@ public interface DockerClient extends Closeable {
*/
LogSwarmObjectCmd logTaskCmd(String taskId);
+ /**
+ * Command to delete unused containers/images/networks/volumes
+ *
+ * @since {@link RemoteApiVersion#VERSION_1_25}
+ */
+ PruneCmd pruneCmd(PruneType pruneType);
+
@Override
void close() throws IOException;
diff --git a/src/main/java/com/github/dockerjava/api/command/BuildImageCmd.java b/src/main/java/com/github/dockerjava/api/command/BuildImageCmd.java
index 9cf3296ce..89d20f531 100644
--- a/src/main/java/com/github/dockerjava/api/command/BuildImageCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/BuildImageCmd.java
@@ -19,7 +19,7 @@
* TODO: http://docs.docker.com/reference/builder/#dockerignore
*
* @see build-image-from-a-dockerfile
+ * href="https://docs.docker.com/reference/api/docker_remote_api_v1.20/#build-image-from-a-dockerfile">build-image-from-a-dockerfile
*/
public interface BuildImageCmd extends AsyncDockerCmd {
@@ -45,6 +45,7 @@ public interface BuildImageCmd extends AsyncDockerCmd getBuildArgs();
/**
- *@since {@link RemoteApiVersion#VERSION_1_22}
+ * @since {@link RemoteApiVersion#VERSION_1_22}
*/
@CheckForNull
Long getShmsize();
@@ -131,11 +132,25 @@ public interface BuildImageCmd extends AsyncDockerCmd)}
+ * specified so use {@link BuildImageCmd#withTags(java.util.Set)}
*/
@Deprecated
BuildImageCmd withTag(String tag);
@@ -185,20 +200,30 @@ public interface BuildImageCmd extends AsyncDockerCmd labels);
/**
- *@since {@link RemoteApiVersion#VERSION_1_25}
+ * @since {@link RemoteApiVersion#VERSION_1_25}
*/
BuildImageCmd withNetworkMode(String networkMode);
+ /**
+ *@since {@link RemoteApiVersion#VERSION_1_32}
+ */
+ BuildImageCmd withPlatform(String platform);
+
+ /**
+ * @since {@link RemoteApiVersion#VERSION_1_38}
+ */
+ BuildImageCmd withTarget(String target);
+
interface Exec extends DockerCmdAsyncExec {
}
diff --git a/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java b/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java
index 34682a14f..c7eb442da 100644
--- a/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/CreateContainerCmd.java
@@ -5,16 +5,12 @@
import com.github.dockerjava.api.model.AuthConfig;
import com.github.dockerjava.api.model.Bind;
import com.github.dockerjava.api.model.Capability;
-import com.github.dockerjava.api.model.Device;
import com.github.dockerjava.api.model.ExposedPort;
+import com.github.dockerjava.api.model.HealthCheck;
import com.github.dockerjava.api.model.HostConfig;
import com.github.dockerjava.api.model.Link;
-import com.github.dockerjava.api.model.LogConfig;
-import com.github.dockerjava.api.model.LxcConf;
import com.github.dockerjava.api.model.PortBinding;
import com.github.dockerjava.api.model.Ports;
-import com.github.dockerjava.api.model.RestartPolicy;
-import com.github.dockerjava.api.model.Ulimit;
import com.github.dockerjava.api.model.Volume;
import com.github.dockerjava.api.model.VolumesFrom;
@@ -27,438 +23,352 @@ public interface CreateContainerCmd extends SyncDockerCmd getAliases();
-
- @CheckForNull
- Bind[] getBinds();
-
/**
- * @since 1.19
+ * While using swarm classic, you can provide an optional auth config which will be used to pull images from a private registry,
+ * if the swarm node does not already have the docker image.
+ * Note: This option does not have any effect in normal docker
+ *
+ * @param authConfig The optional auth config
*/
- @CheckForNull
- Integer getBlkioWeight();
+ CreateContainerCmd withAuthConfig(AuthConfig authConfig);
@CheckForNull
- Capability[] getCapAdd();
+ List getAliases();
+ @Deprecated
@CheckForNull
- Capability[] getCapDrop();
+ Bind[] getBinds();
- @CheckForNull
- String[] getCmd();
+ @Deprecated
+ CreateContainerCmd withBinds(Bind... binds);
+
+ @Deprecated
+ CreateContainerCmd withBinds(List binds);
/**
- * @since 1.19
+ * Add network-scoped alias for the container
+ *
+ * @param aliases on ore more aliases
*/
- @CheckForNull
- Integer getCpuPeriod();
-
- @CheckForNull
- String getCpusetCpus();
+ CreateContainerCmd withAliases(List aliases);
/**
- * @since 1.19
+ * Add network-scoped alias for the container
+ *
+ * @param aliases on ore more aliases
*/
- @CheckForNull
- String getCpusetMems();
+ CreateContainerCmd withAliases(String... aliases);
@CheckForNull
- Integer getCpuShares();
+ String[] getCmd();
- @CheckForNull
- Device[] getDevices();
+ CreateContainerCmd withCmd(String... cmd);
+
+ CreateContainerCmd withCmd(List cmd);
@CheckForNull
- String[] getDns();
+ HealthCheck getHealthcheck();
+
+ CreateContainerCmd withHealthcheck(HealthCheck healthCheck);
@CheckForNull
- String[] getDnsSearch();
+ Boolean getArgsEscaped();
+
+ CreateContainerCmd withArgsEscaped(Boolean argsEscaped);
@CheckForNull
String getDomainName();
+ CreateContainerCmd withDomainName(String domainName);
+
@CheckForNull
String[] getEntrypoint();
+ CreateContainerCmd withEntrypoint(String... entrypoint);
+
+ CreateContainerCmd withEntrypoint(List entrypoint);
+
@CheckForNull
String[] getEnv();
+ CreateContainerCmd withEnv(String... env);
+
+ CreateContainerCmd withEnv(List env);
+
@CheckForNull
ExposedPort[] getExposedPorts();
+ CreateContainerCmd withExposedPorts(List exposedPorts);
+
+ CreateContainerCmd withExposedPorts(ExposedPort... exposedPorts);
+
@CheckForNull
String getStopSignal();
+ CreateContainerCmd withStopSignal(String stopSignal);
+
@CheckForNull
- String[] getExtraHosts();
+ Integer getStopTimeout();
+
+ CreateContainerCmd withStopTimeout(Integer stopTimeout);
@CheckForNull
String getHostName();
+ CreateContainerCmd withHostName(String hostName);
+
@CheckForNull
String getImage();
- @CheckForNull
- String getIpv4Address();
+ CreateContainerCmd withImage(String image);
@CheckForNull
- String getIpv6Address();
+ String getIpv4Address();
- @CheckForNull
- Map getLabels();
+ CreateContainerCmd withIpv4Address(String ipv4Address);
+ @Deprecated
@CheckForNull
Link[] getLinks();
+ /**
+ * Add link to another container.
+ */
+ @Deprecated
+ CreateContainerCmd withLinks(Link... links);
+
+ /**
+ * Add link to another container.
+ */
+ @Deprecated
+ CreateContainerCmd withLinks(List links);
+
@CheckForNull
- LogConfig getLogConfig();
+ String getIpv6Address();
+
+ CreateContainerCmd withIpv6Address(String ipv6Address);
@CheckForNull
- LxcConf[] getLxcConf();
+ Map getLabels();
+
+ CreateContainerCmd withLabels(Map labels);
@CheckForNull
String getMacAddress();
+ CreateContainerCmd withMacAddress(String macAddress);
+
+ @Deprecated
@CheckForNull
Long getMemory();
+ @Deprecated
+ CreateContainerCmd withMemory(Long memory);
+
+ @Deprecated
@CheckForNull
Long getMemorySwap();
+ @Deprecated
+ CreateContainerCmd withMemorySwap(Long memorySwap);
+
@CheckForNull
String getName();
+ @Deprecated
@CheckForNull
String getNetworkMode();
+ /**
+ * Set the Network mode for the container
+ *
+ *
'bridge': creates a new network stack for the container on the docker bridge
+ *
'none': no networking for this container
+ *
'container:': reuses another container network stack
+ *
'host': use the host network stack inside the container. Note: the host mode gives the container full access to local system
+ * services such as D-bus and is therefore considered insecure.
+ *
+ */
+ @Deprecated
+ CreateContainerCmd withNetworkMode(String networkMode);
+
+ @Deprecated
@CheckForNull
Ports getPortBindings();
+ /**
+ * Add one or more {@link PortBinding}s. This corresponds to the --publish (-p) option of the
+ * docker run CLI command.
+ */
+ @Deprecated
+ CreateContainerCmd withPortBindings(PortBinding... portBindings);
+
+ /**
+ * Add one or more {@link PortBinding}s. This corresponds to the --publish (-p) option of the
+ * docker run CLI command.
+ */
+ @Deprecated
+ CreateContainerCmd withPortBindings(List portBindings);
+
+ /**
+ * Add the port bindings that are contained in the given {@link Ports} object.
+ *
+ * @see #withPortBindings(PortBinding...)
+ */
+ @Deprecated
+ CreateContainerCmd withPortBindings(Ports portBindings);
+
+ CreateContainerCmd withName(String name);
+
@CheckForNull
String[] getPortSpecs();
- @CheckForNull
- RestartPolicy getRestartPolicy();
+ CreateContainerCmd withPortSpecs(String... portSpecs);
+ CreateContainerCmd withPortSpecs(List portSpecs);
+
+ @Deprecated
@CheckForNull
- Ulimit[] getUlimits();
+ Boolean getPrivileged();
+
+ @Deprecated
+ CreateContainerCmd withPrivileged(Boolean privileged);
@CheckForNull
String getUser();
+ CreateContainerCmd withUser(String user);
+
@CheckForNull
Volume[] getVolumes();
+ CreateContainerCmd withVolumes(Volume... volumes);
+
+ CreateContainerCmd withVolumes(List volumes);
+
+ @Deprecated
@CheckForNull
VolumesFrom[] getVolumesFrom();
+ @Deprecated
+ CreateContainerCmd withVolumesFrom(VolumesFrom... volumesFrom);
+
+ @Deprecated
+ CreateContainerCmd withVolumesFrom(List volumesFrom);
+
@CheckForNull
String getWorkingDir();
+ CreateContainerCmd withWorkingDir(String workingDir);
+
@CheckForNull
Boolean isAttachStderr();
+ CreateContainerCmd withAttachStderr(Boolean attachStderr);
+
@CheckForNull
Boolean isAttachStdin();
+ CreateContainerCmd withAttachStdin(Boolean attachStdin);
+
@CheckForNull
Boolean isAttachStdout();
+ CreateContainerCmd withAttachStdout(Boolean attachStdout);
+
@CheckForNull
Boolean isNetworkDisabled();
- /**
- * @since 1.19
- */
- @CheckForNull
- Boolean getOomKillDisable();
+ CreateContainerCmd withNetworkDisabled(Boolean disableNetwork);
@CheckForNull
- Boolean getPrivileged();
+ Boolean isStdInOnce();
- @CheckForNull
- Boolean getPublishAllPorts();
+ CreateContainerCmd withStdInOnce(Boolean stdInOnce);
@CheckForNull
- Boolean getReadonlyRootfs();
+ Boolean isStdinOpen();
- @CheckForNull
- Boolean isStdInOnce();
+ CreateContainerCmd withStdinOpen(Boolean stdinOpen);
@CheckForNull
- Boolean isStdinOpen();
+ Boolean isTty();
- @CheckForNull
- String getPidMode();
+ CreateContainerCmd withTty(Boolean tty);
+ @Deprecated
@CheckForNull
- HostConfig getHostConfig();
+ Boolean getPublishAllPorts();
- @CheckForNull
- String getCgroupParent();
+ @Deprecated
+ CreateContainerCmd withPublishAllPorts(Boolean publishAllPorts);
@CheckForNull
- Boolean isTty();
-
- /**
- * While using swarm classic, you can provide an optional auth config which will be used to pull images from a private registry,
- * if the swarm node does not already have the docker image.
- * Note: This option does not have any effect in normal docker
- * @param authConfig The optional auth config
- */
- CreateContainerCmd withAuthConfig(AuthConfig authConfig);
+ @Deprecated
+ String[] getExtraHosts();
/**
- * Add network-scoped alias for the container
- * @param aliases on ore more aliases
+ * Add hostnames to /etc/hosts in the container
*/
- CreateContainerCmd withAliases(String... aliases);
+ @Deprecated
+ CreateContainerCmd withExtraHosts(String... extraHosts);
/**
- * Add network-scoped alias for the container
- * @param aliases on ore more aliases
+ * Add hostnames to /etc/hosts in the container
*/
- CreateContainerCmd withAliases(List aliases);
-
- CreateContainerCmd withAttachStderr(Boolean attachStderr);
-
- CreateContainerCmd withAttachStdin(Boolean attachStdin);
-
- CreateContainerCmd withAttachStdout(Boolean attachStdout);
-
- CreateContainerCmd withBinds(Bind... binds);
-
- CreateContainerCmd withBinds(List binds);
+ @Deprecated
+ CreateContainerCmd withExtraHosts(List extraHosts);
- /**
- * @since 1.19
- */
- CreateContainerCmd withBlkioWeight(Integer blkioWeight);
+ @CheckForNull
+ @Deprecated
+ Capability[] getCapAdd();
/**
* Add linux kernel capability to the container. For example:
* adding {@link Capability#MKNOD} allows the container to create special files using the 'mknod' command.
*/
+ @Deprecated
CreateContainerCmd withCapAdd(Capability... capAdd);
/**
* Add linux kernel capability to the container. For example:
* adding {@link Capability#MKNOD} allows the container to create special files using the 'mknod' command.
*/
+ @Deprecated
CreateContainerCmd withCapAdd(List capAdd);
+ @CheckForNull
+ @Deprecated
+ Capability[] getCapDrop();
+
/**
* Drop linux kernel capability from the container. For example:
* dropping {@link Capability#CHOWN} prevents the container from changing the owner of any files.
*/
+ @Deprecated
CreateContainerCmd withCapDrop(Capability... capDrop);
/**
* Drop linux kernel capability from the container. For example:
* dropping {@link Capability#CHOWN} prevents the container from changing the owner of any files.
*/
+ @Deprecated
CreateContainerCmd withCapDrop(List capDrop);
- CreateContainerCmd withCmd(String... cmd);
-
- CreateContainerCmd withCmd(List cmd);
-
- CreateContainerCmd withContainerIDFile(String containerIDFile);
-
- /**
- * @since 1.19
- */
- CreateContainerCmd withCpuPeriod(Integer cpuPeriod);
-
- CreateContainerCmd withCpusetCpus(String cpusetCpus);
-
- /**
- * @since 1.19
- */
- CreateContainerCmd withCpusetMems(String cpusetMems);
-
- CreateContainerCmd withCpuShares(Integer cpuShares);
-
- /**
- * Add host devices to the container
- */
- CreateContainerCmd withDevices(Device... devices);
-
- /**
- * Add host devices to the container
- */
- CreateContainerCmd withDevices(List devices);
-
- /**
- * Set custom DNS servers
- */
- CreateContainerCmd withDns(String... dns);
-
- /**
- * Set custom DNS servers
- */
- CreateContainerCmd withDns(List dns);
-
- /**
- * Set custom DNS search domains
- */
- CreateContainerCmd withDnsSearch(String... dnsSearch);
-
- /**
- * Set custom DNS search domains
- */
- CreateContainerCmd withDnsSearch(List dnsSearch);
-
- CreateContainerCmd withDomainName(String domainName);
-
- CreateContainerCmd withEntrypoint(String... entrypoint);
-
- CreateContainerCmd withEntrypoint(List entrypoint);
-
- CreateContainerCmd withEnv(String... env);
-
- CreateContainerCmd withEnv(List env);
-
- CreateContainerCmd withExposedPorts(ExposedPort... exposedPorts);
-
- CreateContainerCmd withStopSignal(String stopSignal);
-
- CreateContainerCmd withExposedPorts(List exposedPorts);
-
- /**
- * Add hostnames to /etc/hosts in the container
- */
- CreateContainerCmd withExtraHosts(String... extraHosts);
- /**
- * Add hostnames to /etc/hosts in the container
- */
- CreateContainerCmd withExtraHosts(List extraHosts);
-
- CreateContainerCmd withHostName(String hostName);
-
- CreateContainerCmd withImage(String image);
-
- CreateContainerCmd withIpv4Address(String ipv4Address);
-
- CreateContainerCmd withIpv6Address(String ipv6Address);
-
- CreateContainerCmd withLabels(Map labels);
-
- /**
- * Add link to another container.
- */
- CreateContainerCmd withLinks(Link... links);
-
- /**
- * Add link to another container.
- */
- CreateContainerCmd withLinks(List links);
-
- CreateContainerCmd withLogConfig(LogConfig logConfig);
-
- CreateContainerCmd withLxcConf(LxcConf... lxcConf);
-
- CreateContainerCmd withLxcConf(List lxcConf);
-
- CreateContainerCmd withMacAddress(String macAddress);
-
- CreateContainerCmd withMemory(Long memory);
-
- CreateContainerCmd withMemorySwap(Long memorySwap);
-
- CreateContainerCmd withName(String name);
-
- CreateContainerCmd withNetworkDisabled(Boolean disableNetwork);
-
- /**
- * Set the Network mode for the container
- *
- *
'bridge': creates a new network stack for the container on the docker bridge
- *
'none': no networking for this container
- *
'container:': reuses another container network stack
- *
'host': use the host network stack inside the container. Note: the host mode gives the container full access to local system
- * services such as D-bus and is therefore considered insecure.
- *
- */
- CreateContainerCmd withNetworkMode(String networkMode);
-
- /**
- * @since 1.19
- */
- CreateContainerCmd withOomKillDisable(Boolean oomKillDisable);
-
- /**
- * Add one or more {@link PortBinding}s. This corresponds to the --publish (-p) option of the
- * docker run CLI command.
- */
- CreateContainerCmd withPortBindings(PortBinding... portBindings);
-
- /**
- * Add one or more {@link PortBinding}s. This corresponds to the --publish (-p) option of the
- * docker run CLI command.
- */
- CreateContainerCmd withPortBindings(List portBindings);
-
- /**
- * Add the port bindings that are contained in the given {@link Ports} object.
- *
- * @see #withPortBindings(PortBinding...)
- */
- CreateContainerCmd withPortBindings(Ports portBindings);
-
- CreateContainerCmd withPortSpecs(String... portSpecs);
-
- CreateContainerCmd withPortSpecs(List portSpecs);
-
- CreateContainerCmd withPrivileged(Boolean privileged);
-
- CreateContainerCmd withPublishAllPorts(Boolean publishAllPorts);
-
- CreateContainerCmd withReadonlyRootfs(Boolean readonlyRootfs);
-
- /**
- * Set custom {@link RestartPolicy} for the container. Defaults to {@link RestartPolicy#noRestart()}
- */
- CreateContainerCmd withRestartPolicy(RestartPolicy restartPolicy);
-
- CreateContainerCmd withStdInOnce(Boolean stdInOnce);
-
- CreateContainerCmd withStdinOpen(Boolean stdinOpen);
-
- CreateContainerCmd withTty(Boolean tty);
-
- CreateContainerCmd withUlimits(Ulimit... ulimits);
-
- CreateContainerCmd withUlimits(List ulimits);
-
- CreateContainerCmd withUser(String user);
-
- CreateContainerCmd withVolumes(Volume... volumes);
-
- CreateContainerCmd withVolumes(List volumes);
-
- CreateContainerCmd withVolumesFrom(VolumesFrom... volumesFrom);
-
- CreateContainerCmd withVolumesFrom(List volumesFrom);
-
- CreateContainerCmd withWorkingDir(String workingDir);
+ @CheckForNull
+ List getOnBuild();
- CreateContainerCmd withCgroupParent(String cgroupParent);
+ CreateContainerCmd withOnBuild(List onBuild);
- /**
- * Set the PID (Process) Namespace mode for the container, 'host': use the host's PID namespace inside the container
- */
- CreateContainerCmd withPidMode(String pidMode);
+ @CheckForNull
+ HostConfig getHostConfig();
CreateContainerCmd withHostConfig(HostConfig hostConfig);
/**
- * @throws NotFoundException
- * No such container
- * @throws ConflictException
- * Named container already exists
+ * @throws NotFoundException No such container
+ * @throws ConflictException Named container already exists
*/
@Override
CreateContainerResponse exec() throws NotFoundException, ConflictException;
diff --git a/src/main/java/com/github/dockerjava/api/command/CreateImageCmd.java b/src/main/java/com/github/dockerjava/api/command/CreateImageCmd.java
index 86935cd10..4e78dd5e0 100644
--- a/src/main/java/com/github/dockerjava/api/command/CreateImageCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/CreateImageCmd.java
@@ -13,6 +13,9 @@ public interface CreateImageCmd extends SyncDockerCmd {
@CheckForNull
String getTag();
+ @CheckForNull
+ String getPlatform();
+
@CheckForNull
InputStream getImageStream();
@@ -35,6 +38,12 @@ public interface CreateImageCmd extends SyncDockerCmd {
*/
CreateImageCmd withTag(String tag);
+ /**
+ * @param platform
+ * the platform for this image
+ */
+ CreateImageCmd withPlatform(String platform);
+
interface Exec extends DockerCmdSyncExec {
}
diff --git a/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java b/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
index 3392ce372..f9c142255 100644
--- a/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
+++ b/src/main/java/com/github/dockerjava/api/command/DockerCmdExecFactory.java
@@ -207,6 +207,13 @@ public interface DockerCmdExecFactory extends Closeable {
*/
ListTasksCmd.Exec listTasksCmdExec();
+ /**
+ * Delete unused content (containers, images, volumes, networks, build relicts)
+ *
+ * @since {@link RemoteApiVersion#VERSION_1_25}
+ */
+ PruneCmd.Exec pruneCmdExec();
+
@Override
void close() throws IOException;
diff --git a/src/main/java/com/github/dockerjava/api/command/ExecCreateCmd.java b/src/main/java/com/github/dockerjava/api/command/ExecCreateCmd.java
index 1ab974644..c03a6334a 100644
--- a/src/main/java/com/github/dockerjava/api/command/ExecCreateCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/ExecCreateCmd.java
@@ -1,5 +1,7 @@
package com.github.dockerjava.api.command;
+import java.util.List;
+
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
@@ -20,12 +22,18 @@ public interface ExecCreateCmd extends SyncDockerCmd {
@CheckForNull
Boolean hasTtyEnabled();
+ @CheckForNull
+ List getEnv();
+
@CheckForNull
String getUser();
@CheckForNull
Boolean getPrivileged();
+ @CheckForNull
+ String getWorkingDir();
+
ExecCreateCmd withAttachStderr(Boolean attachStderr);
ExecCreateCmd withAttachStdin(Boolean attachStdin);
@@ -34,6 +42,8 @@ public interface ExecCreateCmd extends SyncDockerCmd {
ExecCreateCmd withCmd(String... cmd);
+ ExecCreateCmd withEnv(List env);
+
ExecCreateCmd withContainerId(@Nonnull String containerId);
ExecCreateCmd withTty(Boolean tty);
@@ -42,6 +52,8 @@ public interface ExecCreateCmd extends SyncDockerCmd {
ExecCreateCmd withPrivileged(Boolean isPrivileged);
+ ExecCreateCmd withWorkingDir(String workingDir);
+
interface Exec extends DockerCmdSyncExec {
}
diff --git a/src/main/java/com/github/dockerjava/api/command/GraphData.java b/src/main/java/com/github/dockerjava/api/command/GraphData.java
index 5a2944e0b..518970dc6 100644
--- a/src/main/java/com/github/dockerjava/api/command/GraphData.java
+++ b/src/main/java/com/github/dockerjava/api/command/GraphData.java
@@ -28,6 +28,9 @@ public class GraphData {
@JsonProperty("DeviceSize")
private String deviceSize;
+ @JsonProperty("dir")
+ private String dir;
+
/**
* @see #rootDir
*/
@@ -92,6 +95,22 @@ public GraphData withDeviceSize(String deviceSize) {
return this;
}
+ /**
+ * @see #dir
+ */
+ @CheckForNull
+ public String getDir() {
+ return dir;
+ }
+
+ /**
+ * @see #dir
+ */
+ public GraphData withDir(String dir) {
+ this.dir = dir;
+ return this;
+ }
+
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
diff --git a/src/main/java/com/github/dockerjava/api/command/GraphDriver.java b/src/main/java/com/github/dockerjava/api/command/GraphDriver.java
index 1394e866e..598061168 100644
--- a/src/main/java/com/github/dockerjava/api/command/GraphDriver.java
+++ b/src/main/java/com/github/dockerjava/api/command/GraphDriver.java
@@ -10,7 +10,7 @@
import javax.annotation.CheckForNull;
/**
- * Part of {@link InspectImageResponse}
+ * Part of {@link InspectImageResponse} and {@link InspectContainerResponse}
*
* @author Kanstantsin Shautsou
* @since {@link com.github.dockerjava.core.RemoteApiVersion#VERSION_1_21}
diff --git a/src/main/java/com/github/dockerjava/api/command/InspectContainerResponse.java b/src/main/java/com/github/dockerjava/api/command/InspectContainerResponse.java
index 7e60b0be3..cc2761abe 100644
--- a/src/main/java/com/github/dockerjava/api/command/InspectContainerResponse.java
+++ b/src/main/java/com/github/dockerjava/api/command/InspectContainerResponse.java
@@ -110,6 +110,15 @@ public class InspectContainerResponse {
@JsonProperty("Mounts")
private List mounts;
+ @JsonProperty("GraphDriver")
+ private GraphDriver graphDriver;
+
+ /**
+ * @since {@link RemoteApiVersion#VERSION_1_30}
+ */
+ @JsonProperty("Platform")
+ private String platform;
+
public String getId() {
return id;
}
@@ -227,6 +236,22 @@ public Node getNode() {
return node;
}
+ /**
+ * @see #graphDriver
+ */
+ @CheckForNull
+ public GraphDriver getGraphDriver() {
+ return graphDriver;
+ }
+
+ /**
+ * @see #platform
+ */
+ @CheckForNull
+ public String getPlatform() {
+ return platform;
+ }
+
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
diff --git a/src/main/java/com/github/dockerjava/api/command/InspectImageResponse.java b/src/main/java/com/github/dockerjava/api/command/InspectImageResponse.java
index c1967e384..19727504e 100644
--- a/src/main/java/com/github/dockerjava/api/command/InspectImageResponse.java
+++ b/src/main/java/com/github/dockerjava/api/command/InspectImageResponse.java
@@ -49,6 +49,12 @@ public class InspectImageResponse {
@JsonProperty("Os")
private String os;
+ /**
+ * @since {@link com.github.dockerjava.core.RemoteApiVersion#VERSION_1_25}
+ */
+ @JsonProperty("OsVersion")
+ private String osVersion;
+
@JsonProperty("Parent")
private String parent;
@@ -73,6 +79,9 @@ public class InspectImageResponse {
@JsonProperty("GraphDriver")
private GraphDriver graphDriver;
+ @JsonProperty("RootFS")
+ private RootFS rootFS;
+
/**
* @see #arch
*/
@@ -236,6 +245,22 @@ public InspectImageResponse withOs(String os) {
return this;
}
+ /**
+ * @see #osVersion
+ */
+ @CheckForNull
+ public String getOsVersion() {
+ return osVersion;
+ }
+
+ /**
+ * @see #osVersion
+ */
+ public InspectImageResponse withOsVersion(String osVersion) {
+ this.osVersion = osVersion;
+ return this;
+ }
+
/**
* @see #parent
*/
@@ -332,6 +357,22 @@ public InspectImageResponse withVirtualSize(Long virtualSize) {
return this;
}
+ /**
+ * @see #rootFS
+ */
+ @CheckForNull
+ public RootFS getRootFS() {
+ return rootFS;
+ }
+
+ /**
+ * @see #rootFS
+ */
+ public InspectImageResponse withRootFS(RootFS rootFS) {
+ this.rootFS = rootFS;
+ return this;
+ }
+
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this);
diff --git a/src/main/java/com/github/dockerjava/api/command/ListNetworksCmd.java b/src/main/java/com/github/dockerjava/api/command/ListNetworksCmd.java
index 23d92151c..40e3d421c 100644
--- a/src/main/java/com/github/dockerjava/api/command/ListNetworksCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/ListNetworksCmd.java
@@ -5,6 +5,7 @@
import javax.annotation.CheckForNull;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -22,6 +23,13 @@ public interface ListNetworksCmd extends SyncDockerCmd> {
ListNetworksCmd withIdFilter(String... networkId);
+ /**
+ * @param filterName
+ * @param filterValues
+ * - Show only networks where the filter matches the given values
+ */
+ ListNetworksCmd withFilter(String filterName, Collection filterValues);
+
interface Exec extends DockerCmdSyncExec> {
}
}
diff --git a/src/main/java/com/github/dockerjava/api/command/ListVolumesCmd.java b/src/main/java/com/github/dockerjava/api/command/ListVolumesCmd.java
index 88c6ee291..bd66653eb 100644
--- a/src/main/java/com/github/dockerjava/api/command/ListVolumesCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/ListVolumesCmd.java
@@ -1,5 +1,6 @@
package com.github.dockerjava.api.command;
+import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -21,6 +22,13 @@ public interface ListVolumesCmd extends SyncDockerCmd {
*/
ListVolumesCmd withDanglingFilter(Boolean dangling);
+ /**
+ * @param filterName
+ * @param filterValues
+ * - Show only volumes where the filter matches the given values
+ */
+ ListVolumesCmd withFilter(String filterName, Collection filterValues);
+
interface Exec extends DockerCmdSyncExec {
}
}
diff --git a/src/main/java/com/github/dockerjava/api/command/PruneCmd.java b/src/main/java/com/github/dockerjava/api/command/PruneCmd.java
new file mode 100644
index 000000000..7a86434aa
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/api/command/PruneCmd.java
@@ -0,0 +1,54 @@
+package com.github.dockerjava.api.command;
+
+import com.github.dockerjava.api.model.PruneResponse;
+import com.github.dockerjava.api.model.PruneType;
+import com.github.dockerjava.core.RemoteApiVersion;
+
+import javax.annotation.CheckForNull;
+import javax.annotation.Nonnull;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Delete unused content (containers, images, volumes, networks, build relicts)
+ *
+ * @since {@link RemoteApiVersion#VERSION_1_25}
+ */
+public interface PruneCmd extends SyncDockerCmd {
+
+ @Nonnull
+ PruneType getPruneType();
+
+ @Nonnull
+ String getApiPath();
+
+ @CheckForNull
+ Map> getFilters();
+
+ PruneCmd withPruneType(final PruneType pruneType);
+ /**
+ * Prune containers created before this timestamp
+ * Meaningful only for CONTAINERS and IMAGES prune type
+ * @param until Can be Unix timestamps, date formatted timestamps,
+ * or Go duration strings (e.g. 10m, 1h30m) computed relative to the daemon machine’s time.
+ */
+ PruneCmd withUntilFilter(String until);
+
+ /**
+ * When set to true, prune only unused and untagged images. When set to false, all unused images are pruned.
+ * Meaningful only for IMAGES prune type
+ */
+ PruneCmd withDangling(Boolean dangling);
+
+ /**
+ * Prune containers with the specified labels
+ */
+ PruneCmd withLabelFilter(String... label);
+
+ @Override
+ PruneResponse exec();
+
+ interface Exec extends DockerCmdSyncExec {
+ }
+
+}
diff --git a/src/main/java/com/github/dockerjava/api/command/PullImageCmd.java b/src/main/java/com/github/dockerjava/api/command/PullImageCmd.java
index 81da24e61..cc95161a5 100644
--- a/src/main/java/com/github/dockerjava/api/command/PullImageCmd.java
+++ b/src/main/java/com/github/dockerjava/api/command/PullImageCmd.java
@@ -19,6 +19,9 @@ public interface PullImageCmd extends AsyncDockerCmd layers;
+
+ /**
+ * @see #type
+ */
+ @CheckForNull
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * @see #type
+ */
+ public RootFS withType(String type) {
+ this.type = type;
+ return this;
+ }
+
+ /**
+ * @see #layers
+ */
+ @CheckForNull
+ public List getLayers() {
+ return layers;
+ }
+
+ /**
+ * @see #layers
+ */
+ public RootFS withLayers(List layers) {
+ this.layers = layers;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return EqualsBuilder.reflectionEquals(this, o);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this);
+ }
+}
diff --git a/src/main/java/com/github/dockerjava/api/model/AuthConfig.java b/src/main/java/com/github/dockerjava/api/model/AuthConfig.java
index 074c6db61..d2ecd7d90 100644
--- a/src/main/java/com/github/dockerjava/api/model/AuthConfig.java
+++ b/src/main/java/com/github/dockerjava/api/model/AuthConfig.java
@@ -21,13 +21,13 @@ public class AuthConfig implements Serializable {
*/
public static final String DEFAULT_SERVER_ADDRESS = "https://index.docker.io/v1/";
- @JsonProperty
+ @JsonProperty("username")
private String username;
- @JsonProperty
+ @JsonProperty("password")
private String password;
- @JsonProperty
+ @JsonProperty("email")
private String email;
@JsonProperty("serveraddress")
@@ -42,6 +42,18 @@ public class AuthConfig implements Serializable {
@JsonProperty("registrytoken")
private String registrytoken;
+ /**
+ * @since {@link com.github.dockerjava.core.RemoteApiVersion#VERSION_1_23}
+ */
+ @JsonProperty("identitytoken")
+ private String identitytoken;
+
+ /**
+ * @since {@link com.github.dockerjava.core.RemoteApiVersion#VERSION_1_25}
+ */
+ @JsonProperty("stackOrchestrator")
+ private String stackOrchestrator;
+
public String getUsername() {
return username;
}
@@ -87,6 +99,20 @@ public AuthConfig withAuth(String auth) {
return this;
}
+ /**
+ * @see #identitytoken
+ */
+ public String getIdentitytoken() {
+ return identitytoken;
+ }
+ /**
+ * @see #identitytoken
+ */
+ public AuthConfig withIdentityToken(String identitytoken) {
+ this.identitytoken = identitytoken;
+ return this;
+ }
+
/**
* @see #registrytoken
*/
@@ -103,6 +129,20 @@ public AuthConfig withRegistrytoken(String registrytoken) {
return this;
}
+ /**
+ * @see #stackOrchestrator
+ */
+ public String getStackOrchestrator() {
+ return stackOrchestrator;
+ }
+
+ /**
+ * @see #stackOrchestrator
+ */
+ public void setStackOrchestrator(String stackOrchestrator) {
+ this.stackOrchestrator = stackOrchestrator;
+ }
+
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
diff --git a/src/main/java/com/github/dockerjava/api/model/BlkioRateDevice.java b/src/main/java/com/github/dockerjava/api/model/BlkioRateDevice.java
new file mode 100644
index 000000000..4e171417f
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/api/model/BlkioRateDevice.java
@@ -0,0 +1,54 @@
+package com.github.dockerjava.api.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+import java.io.Serializable;
+
+import static org.apache.commons.lang.builder.ToStringStyle.SHORT_PREFIX_STYLE;
+
+public class BlkioRateDevice implements Serializable {
+ public static final long serialVersionUID = 1L;
+
+ @JsonProperty("Path")
+ private String path;
+
+ @JsonProperty("Rate")
+ private Long rate;
+
+ public String getPath() {
+ return path;
+ }
+
+ public BlkioRateDevice withPath(String path) {
+ this.path = path;
+ return this;
+ }
+
+ public Long getRate() {
+ return rate;
+ }
+
+ public BlkioRateDevice withRate(Long rate) {
+ this.rate = rate;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this, SHORT_PREFIX_STYLE);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return EqualsBuilder.reflectionEquals(this, o);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this);
+ }
+
+}
diff --git a/src/main/java/com/github/dockerjava/api/model/BlkioWeightDevice.java b/src/main/java/com/github/dockerjava/api/model/BlkioWeightDevice.java
new file mode 100644
index 000000000..1c8e5cd08
--- /dev/null
+++ b/src/main/java/com/github/dockerjava/api/model/BlkioWeightDevice.java
@@ -0,0 +1,54 @@
+package com.github.dockerjava.api.model;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+import java.io.Serializable;
+
+import static org.apache.commons.lang.builder.ToStringStyle.SHORT_PREFIX_STYLE;
+
+public class BlkioWeightDevice implements Serializable {
+ public static final long serialVersionUID = 1L;
+
+ @JsonProperty("Path")
+ private String path;
+
+ @JsonProperty("Weight")
+ private Integer weight;
+
+ public String getPath() {
+ return path;
+ }
+
+ public BlkioWeightDevice withPath(String path) {
+ this.path = path;
+ return this;
+ }
+
+ public Integer getWeight() {
+ return weight;
+ }
+
+ public BlkioWeightDevice withWeight(Integer weight) {
+ this.weight = weight;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this, SHORT_PREFIX_STYLE);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return EqualsBuilder.reflectionEquals(this, o);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this);
+ }
+
+}
diff --git a/src/main/java/com/github/dockerjava/api/model/ClusterInfo.java b/src/main/java/com/github/dockerjava/api/model/ClusterInfo.java
index d1a233d05..0ee95688b 100644
--- a/src/main/java/com/github/dockerjava/api/model/ClusterInfo.java
+++ b/src/main/java/com/github/dockerjava/api/model/ClusterInfo.java
@@ -23,7 +23,7 @@
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ClusterInfo implements Serializable {
- public static final Long serialVersionUID = 1L;
+ public static final long serialVersionUID = 1L;
/**
* @since 1.24
diff --git a/src/main/java/com/github/dockerjava/api/model/ContainerSpec.java b/src/main/java/com/github/dockerjava/api/model/ContainerSpec.java
index 26cfd9dfe..f56870d01 100644
--- a/src/main/java/com/github/dockerjava/api/model/ContainerSpec.java
+++ b/src/main/java/com/github/dockerjava/api/model/ContainerSpec.java
@@ -22,7 +22,7 @@
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ContainerSpec implements Serializable {
- public static final Long serialVersionUID = 1L;
+ public static final long serialVersionUID = 1L;
/**
* @since 1.24
diff --git a/src/main/java/com/github/dockerjava/api/model/Device.java b/src/main/java/com/github/dockerjava/api/model/Device.java
index 7d73710fd..32155271c 100644
--- a/src/main/java/com/github/dockerjava/api/model/Device.java
+++ b/src/main/java/com/github/dockerjava/api/model/Device.java
@@ -127,8 +127,10 @@ private static boolean validDeviceMode(String deviceMode) {
public boolean equals(Object obj) {
if (obj instanceof Device) {
Device other = (Device) obj;
- return new EqualsBuilder().append(cGroupPermissions, other.getcGroupPermissions())
- .append(pathInContainer, other.getPathInContainer()).append(pathOnHost, other.getPathOnHost())
+ return new EqualsBuilder()
+ .append(cGroupPermissions, other.getcGroupPermissions())
+ .append(pathInContainer, other.getPathInContainer())
+ .append(pathOnHost, other.getPathOnHost())
.isEquals();
} else {
return super.equals(obj);
@@ -137,7 +139,11 @@ public boolean equals(Object obj) {
@Override
public int hashCode() {
- return new HashCodeBuilder().append(cGroupPermissions).append(pathInContainer).append(pathOnHost).toHashCode();
+ return new HashCodeBuilder()
+ .append(cGroupPermissions)
+ .append(pathInContainer)
+ .append(pathOnHost)
+ .toHashCode();
}
}
diff --git a/src/main/java/com/github/dockerjava/api/model/Endpoint.java b/src/main/java/com/github/dockerjava/api/model/Endpoint.java
index 54ae0cad2..0602a3d21 100644
--- a/src/main/java/com/github/dockerjava/api/model/Endpoint.java
+++ b/src/main/java/com/github/dockerjava/api/model/Endpoint.java
@@ -14,7 +14,7 @@
* @since {@link RemoteApiVersion#VERSION_1_24}
*/
public class Endpoint implements Serializable {
- public static final Long serialVersionUID = 1L;
+ public static final long serialVersionUID = 1L;
/**
* @since 1.24
diff --git a/src/main/java/com/github/dockerjava/api/model/EndpointSpec.java b/src/main/java/com/github/dockerjava/api/model/EndpointSpec.java
index e036aac75..38aebe638 100644
--- a/src/main/java/com/github/dockerjava/api/model/EndpointSpec.java
+++ b/src/main/java/com/github/dockerjava/api/model/EndpointSpec.java
@@ -19,7 +19,7 @@
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class EndpointSpec implements Serializable {
- public static final Long serialVersionUID = 1L;
+ public static final long serialVersionUID = 1L;
/**
* @since 1.24
diff --git a/src/main/java/com/github/dockerjava/api/model/EndpointVirtualIP.java b/src/main/java/com/github/dockerjava/api/model/EndpointVirtualIP.java
index 5bc600a4d..369889921 100644
--- a/src/main/java/com/github/dockerjava/api/model/EndpointVirtualIP.java
+++ b/src/main/java/com/github/dockerjava/api/model/EndpointVirtualIP.java
@@ -14,7 +14,7 @@
* @since {@link RemoteApiVersion#VERSION_1_24}
*/
public class EndpointVirtualIP implements Serializable {
- public static final Long serialVersionUID = 1L;
+ public static final long serialVersionUID = 1L;
/**
* @since 1.24
diff --git a/src/main/java/com/github/dockerjava/api/model/ExternalCA.java b/src/main/java/com/github/dockerjava/api/model/ExternalCA.java
index 4377b90d4..ac2cb69fb 100644
--- a/src/main/java/com/github/dockerjava/api/model/ExternalCA.java
+++ b/src/main/java/com/github/dockerjava/api/model/ExternalCA.java
@@ -20,7 +20,7 @@
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ExternalCA implements Serializable {
- public static final Long serialVersionUID = 1L;
+ public static final long serialVersionUID = 1L;
/**
* @since 1.24
diff --git a/src/main/java/com/github/dockerjava/api/model/HealthCheck.java b/src/main/java/com/github/dockerjava/api/model/HealthCheck.java
index d9057c11a..2b0269770 100644
--- a/src/main/java/com/github/dockerjava/api/model/HealthCheck.java
+++ b/src/main/java/com/github/dockerjava/api/model/HealthCheck.java
@@ -18,6 +18,9 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
import java.io.Serializable;
import java.util.List;
@@ -47,7 +50,7 @@ public class HealthCheck implements Serializable {
* @since 1.26
*/
@JsonProperty("Retries")
- private Long retries;
+ private Integer retries;
/**
* @since 1.26
@@ -82,11 +85,11 @@ public HealthCheck withTest(List test) {
return this;
}
- public Long getRetries() {
+ public Integer getRetries() {
return retries;
}
- public HealthCheck withRetries(Long retries) {
+ public HealthCheck withRetries(Integer retries) {
this.retries = retries;
return this;
}
@@ -99,4 +102,19 @@ public HealthCheck withStartPeriod(Long startPeriod) {
this.startPeriod = startPeriod;
return this;
}
+
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return EqualsBuilder.reflectionEquals(this, o);
+ }
+
+ @Override
+ public int hashCode() {
+ return HashCodeBuilder.reflectionHashCode(this);
+ }
}
diff --git a/src/main/java/com/github/dockerjava/api/model/HostConfig.java b/src/main/java/com/github/dockerjava/api/model/HostConfig.java
index 624c4545e..1eb0594b6 100644
--- a/src/main/java/com/github/dockerjava/api/model/HostConfig.java
+++ b/src/main/java/com/github/dockerjava/api/model/HostConfig.java
@@ -16,6 +16,8 @@
import java.util.List;
import java.util.Map;
+import static com.google.common.base.Preconditions.checkNotNull;
+
/**
* Used in `/containers/create`, and in inspect container.
* TODO exclude usage for 2 different models.
@@ -27,6 +29,10 @@ public class HostConfig implements Serializable {
private static final List PREDEFINED_NETWORKS = Arrays.asList("bridge", "host", "none");
+ public static HostConfig newHostConfig() {
+ return new HostConfig();
+ }
+
@JsonProperty("Binds")
private Binds binds;
@@ -37,37 +43,40 @@ public class HostConfig implements Serializable {
* @since {@link com.github.dockerjava.core.RemoteApiVersion#VERSION_1_22}
*/
@JsonProperty("BlkioWeightDevice")
- private List