Browse code

Merge pull request #30921 from anusha-ragunathan/debug_docs

Add plugin socket related debug docs.
(cherry picked from commit fddab1444f2c2f7e240a4bde10971ed84967767b)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2017/02/15 06:10:24
Showing 1 changed files
... ...
@@ -289,3 +289,28 @@ follows:
289 289
 $ docker-runc exec -t f52a3df433b9aceee436eaada0752f5797aab1de47e5485f1690a073b860ff62 sh
290 290
 ```
291 291
 
292
+#### Using curl to debug plugin socket issues.
293
+
294
+To verify if the plugin API socket that the docker daemon communicates with
295
+is responsive, use curl. In this example, we will make API calls from the 
296
+docker host to volume and network plugins using curl 7.47.0 to ensure that
297
+the plugin is listening on the said socket. For a well functioning plugin,
298
+these basic requests should work. Note that plugin sockets are available on the host under `/var/run/docker/plugins/<pluginID>`
299
+
300
+
301
+```bash
302
+curl -H "Content-Type: application/json" -XPOST -d '{}' --unix-socket /var/run/docker/plugins/e8a37ba56fc879c991f7d7921901723c64df6b42b87e6a0b055771ecf8477a6d/plugin.sock http:/VolumeDriver.List
303
+
304
+{"Mountpoint":"","Err":"","Volumes":[{"Name":"myvol1","Mountpoint":"/data/myvol1"},{"Name":"myvol2","Mountpoint":"/data/myvol2"}],"Volume":null}
305
+```
306
+
307
+```bash
308
+curl -H "Content-Type: application/json" -XPOST -d '{}' --unix-socket /var/run/docker/plugins/45e00a7ce6185d6e365904c8bcf62eb724b1fe307e0d4e7ecc9f6c1eb7bcdb70/plugin.sock http:/NetworkDriver.GetCapabilities
309
+
310
+{"Scope":"local"}
311
+```
312
+When using curl 7.5 and above, the URL should be of the form 
313
+`http://hostname/APICall`, where `hostname` is the valid hostname where the 
314
+plugin is installed and `APICall` is the call to the plugin API.
315
+
316
+For example, `http://localhost/VolumeDriver.List`