Skip to content

Commit 2114d0e

Browse files
committed
Updated DockerClientConfig so that environment properties can be used to configure Docker. Made a couple of public methods private.
1 parent c35f025 commit 2114d0e

File tree

5 files changed

+565
-345
lines changed

5 files changed

+565
-345
lines changed

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ There are a couple of configuration items, all of which have sensible defaults:
8686

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

89-
#### Programatic:
89+
#### Programmatic:
9090
In your application, e.g.
9191

92-
DockerClientConfigBuilder configBuilder = DockerClientConfig.createDefaultConfigBuilder();
93-
configBuilder.withVersion("1.15");
94-
configBuilder.withUri("https://my-docker-host.tld:2376");
95-
configBuilder.withUsername("dockeruser");
96-
configBuilder.withPassword("ilovedocker");
97-
configBuilder.withEmail("dockeruser@github.com");
98-
configBuilder.withDockerCertPath("/home/user/.docker");
99-
DockerClientConfig config = configBuilder.build();
92+
DockerClientConfig config = DockerClientConfig.createDefaultConfigBuilder()
93+
.withVersion("1.15")
94+
.withUri("https://my-docker-host.tld:2376")
95+
.withUsername("dockeruser")
96+
.withPassword("ilovedocker")
97+
.withEmail("dockeruser@github.com")
98+
.withDockerCertPath("/home/user/.docker")
99+
.build();
100100
DockerClient docker = DockerClientBuilder.getInstance(config).build();
101101

102102
#### Properties
@@ -113,6 +113,12 @@ In your application, e.g.
113113

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

116+
##### System Environment
117+
118+
export DOCKER_URL=http://localhost:2376
119+
120+
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.
121+
116122
##### File System
117123

118124
In `$HOME/.docker.io.properties`

0 commit comments

Comments
 (0)