Files
deb-python-requests-unixsocket/sample.py
Marc Abramowitz 49872aaf25 Add sample.py
Example of using lib to get info from `/var/run/docker.sock`
2017-02-19 12:13:33 -08:00

10 lines
235 B
Python

import json
import requests_unixsocket
session = requests_unixsocket.Session()
r = session.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info')
registry_config = r.json()['RegistryConfig']
print(json.dumps(registry_config, indent=4))