Get disk usage for all the containers with python script

2017-01-16 1 min read Python
With my increasing love for python, here is my attempt to get the disk usage of all the containers on some host. Well, since the requirements vary for everyone, so this script is far from complete. import docker import json # We will connect to 192.168.122.1 for docker daemon. If that is not the case, # then change the below. client = docker.DockerClient(base_url="tcp://192.168.122.1:4243") # Get list of all containers. cls=client.containers.list() stats={} # And now we will iterate over that list to get stats for all the containers. Continue reading