Java Docker API Client
Clone or download
Pull request Compare This branch is 1455 commits behind docker-java:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Java API client for Docker

Supports a subset of the Docker Client API v1.14, Docker Server version 1.2.0

Developer forum for docker-java

Build with Maven

  • Java 1.6+
  • Maven 3.0.5
  • Docker daemon running

Maven may run tests during build process but tests are disabled by default. The tests are using a localhost instance of Docker, make sure that you have Docker running for tests to work. To run the tests you have to provide your information:

$ mvn clean install -DskipTests=false

By default Docker server is using UNIX sockets for communication with the Docker client, however docker-java client uses TCP/IP to connect to the Docker server, so you will need to make sure that your Docker server is listening on TCP port. To allow Docker server to use TCP add the following line to /etc/default/docker

DOCKER_OPTS="-H tcp:// -H unix:///var/run/docker.sock"

More details setting up docket server can be found in official documentation:

Now make sure that docker is up:

$ docker -H tcp:// version

Client version: 0.8.0
Go version (client): go1.2
Git commit (client): cc3a8c8
Server version: 1.2.0
Git commit (server): fa7b24f
Go version (server): go1.3.1

Run build with tests:

$ mvn clean install -DskipTests=false

Docker-Java maven dependencies

Latest release version


Latest SNAPSHOT version


Latest SNAPSHOT is published to maven repo: via Build on CloudBees


For code examples, please look at the Wiki or Test cases


There are a couple of configuration items, all of which have sensible defaults:

  • url The Docker URL, e.g. http://localhost:2375.
  • version The API version, e.g. 1.14.
  • username Your repository username (required to push containers).
  • password Your repository password.
  • email Your repository email.

There are three ways to configure, in descending order of precedence:


In your application, e.g.

DockerClientConfig config = DockerClientConfig.createDefaultConfigBuilder();
DockerClient docker = new DockerClientImpl(config);
System Properties:


java pkg.Main
File System

In $HOME/, e.g.:
Class Path

In the class path at /, e.g.: