Skip to content

Instantly share code, notes, and snippets.

@tobilg
Last active January 12, 2018 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobilg/0284d041b9e9eb439cd5dfdd3c7a03ca to your computer and use it in GitHub Desktop.
Save tobilg/0284d041b9e9eb439cd5dfdd3c7a03ca to your computer and use it in GitHub Desktop.
Get the Docker Hub statistics for a specific user's images as CSV. Needs curl and jq installed. Usage: ./docker_hub_stats.sh yourUserName
#!/bin/bash
curl -s https://hub.docker.com/v2/repositories/$1/\?page_size\=1000 | jq -r '["user", "name", "description", "star_count", "pull_count"] as $fields | $fields, (.results[] | [.[$fields[]]]) | @csv'
@tobilg
Copy link
Author

tobilg commented Jan 12, 2018

This will produce the following output for the google user:

"user","name","description","star_count","pull_count"
"google","cadvisor","Analyzes resource usage and performance characteristics of running containers.",259,595807068
"google","docker-registry","Docker Registry w/ Google Cloud Storage driver.",32,9991989
"google","cloud-sdk","Google Cloud SDKbundle with all components and dependencies ",149,5584942
"google","nodejs-hello","",16,2741441
"google","guestbook-python-redis","A simple guestbook example written in Python.  It works against a redis backend.",1,2319137
"google","nodejs-runtime","",76,1368406
"google","debian","",52,1132910
"google","golang-runtime","",49,905196
"google","pause","",3,837655
"google","golang","",101,318155
"google","golang-hello","",8,245069
"google","nodejs","",73,176285
"google","ruby-hello","",2,113194
"google","python-hello","",2,69234
"google","python","Please use gcr.io/google-appengine/python instead of this image.",36,53032
"google","mysql","MySQL server for Google Compute Engine",18,46053
"google","python-runtime","Please use gcr.io/google-appengine/python instead of this image.",19,44321
"google","ruby","",5,42600
"google","cadvisor-canary","Analyzes resource usage and performance characteristics of running containers.",20,36678
"google","ruby-runtime","",2,35409
"google","dart","Base image with the Dart SDK",24,28768
"google","dart-hello","Image for a simple Dart HTTP server",5,21540
"google","dart-runtime","Base image that makes it easy to dockerize a standard Dart application",9,20340
"google","apparmor-loader","",0,16804
"google","dart-runtime-base","Base image to dockerize a standard Dart application which is using local packages",6,12846
"google","shaka-packager","A media packaging and development framework for VOD and Live DASH and HLS applications.",4,2231
"google","fluentd-bigquery-sample","sample nginx with fluentd and BigQuery Connector",1,678
"google","webfundamentals","",2,642
"google","edash-packager","A MPEG-DASH packaging SDK and application with Common Encryption support",4,407
"google","dart-test-runner","",0,379
"google","ipython-predictions","",1,347
"google","docker-registry-gcs","",1,341
"google","drone-firebase","Drone plugin to deploy a project to Firebase",1,109
"google","ipython","IPython cloud environment",2,1
"google","test","",0,0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment