@@ -6,6 +6,7 @@ This user manual is made to correspond to Docker's [API docs][1] (e.g. [API 1.18
6
6
* [ Unix socket support] ( #unix-socket-support )
7
7
* [ HTTPS support] ( #https-support )
8
8
* [ Connection pooling] ( #connection-pooling )
9
+ * [ Authentication to private registries] ( #authentication-to-private-registries )
9
10
* [ Containers] ( #containers )
10
11
* [ List containers] ( #list-containers )
11
12
* [ Create a container] ( #create-a-container )
@@ -114,6 +115,35 @@ Note that the connect timeout is also applied to acquiring a connection from the
114
115
is exhausted and it takes too long to acquire a new connection for a request, we throw a
115
116
` DockerTimeoutException ` instead of just waiting forever on a connection becoming available.
116
117
118
+ ## Authentication to private registries
119
+
120
+ Authentication info when building, pushing, or pulling images, or when using
121
+ Swarm, is provided by a ` RegistryAuthSupplier ` class.
122
+
123
+ Docker-client is packaged with a few implementations of this interface
124
+
125
+ - ` auth.ConfigFileRegistryAuthSupplier ` , which reads authentication info from
126
+ the the config files used by docker-cli (` ~/.dockercfg ` or
127
+ ` ~/.docker/config.json ` )
128
+ - ` auth.NoOpRegistryAuthSupplier ` which uses a fixed instance of the
129
+ ` RegistryAuth ` and ` RegistryConfigs ` POJOs
130
+ - ` auth.gcr.ContainerRegistryAuthSupplier ` , which programmatically fetches
131
+ access tokens for use with Google Container Registry based on given Gogole
132
+ Cloud account credentials
133
+ - ` auth.MultiRegistryAuthSupplier ` , which can be used to combine multiple other
134
+ implementations
135
+
136
+ Users are encouraged to implement the ` RegistryAuthSupplier ` interface
137
+ themselves to support custom authentication logic, and we would be happy to
138
+ review and accept pull requests to add support in the library for additional
139
+ schemes.
140
+
141
+ Since version 8.7.0, docker-client will automatically enable the
142
+ ` ConfigFileRegistryAuthSupplier ` class in ` DefaultDockerClient ` as long as none
143
+ of the other authentication-related methods in the
144
+ ` DefaultDockerClient.Builder ` class (` dockerAuth(boolean) ` ,
145
+ ` registryAuth(RegistryAuth) ` , or ` registryAuthSupplier(RegistryAuthSupplier) ` )
146
+ are used.
117
147
118
148
## Containers
119
149
0 commit comments