File: docker-info.py

package info (click to toggle)
python-requests-unixsocket 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 256 kB
  • sloc: python: 316; sh: 23; makefile: 14
file content (11 lines) | stat: -rwxr-xr-x 258 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env 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))