Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Updated DockerClientConfig so that environment properties can be used…
… to configure Docker. Made a couple of public methods private.
  • Loading branch information
alexec committed Oct 26, 2014
commit 2114d0e368cfe457d55dfa6e5c7dc9f116743fbe
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ There are a couple of configuration items, all of which have sensible defaults:

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

#### Programatic:
#### Programmatic:
In your application, e.g.

DockerClientConfigBuilder configBuilder = DockerClientConfig.createDefaultConfigBuilder();
configBuilder.withVersion("1.15");
configBuilder.withUri("https://my-docker-host.tld:2376");
configBuilder.withUsername("dockeruser");
configBuilder.withPassword("ilovedocker");
configBuilder.withEmail("dockeruser@github.com");
configBuilder.withDockerCertPath("/home/user/.docker");
DockerClientConfig config = configBuilder.build();
DockerClientConfig config = DockerClientConfig.createDefaultConfigBuilder()
.withVersion("1.15")
.withUri("https://my-docker-host.tld:2376")
.withUsername("dockeruser")
.withPassword("ilovedocker")
.withEmail("dockeruser@github.com")
.withDockerCertPath("/home/user/.docker")
.build();
DockerClient docker = DockerClientBuilder.getInstance(config).build();

#### Properties
Expand All @@ -113,6 +113,12 @@ In your application, e.g.

java -Ddocker.io.username=dockeruser pkg.Main

##### System Environment

export DOCKER_URL=http://localhost:2376

Note: we also auto-detect defaults. If you use `DOCKER_HOST` we use that value, and if `DOCKER_CERT_PATH` is set, we switch to SSL.

##### File System

In `$HOME/.docker.io.properties`
Expand Down
Loading