Reputation: 1396
I have a docker image on hub.docker.com. Is there a way to find out who is using my docker image or who is pulling it? Any statistics that hub.docker.com can provide.
Upvotes: 11
Views: 9066
Reputation: 1
It's an old thread. Just stubling on this.
I also used an exporter (different one as the one from predatorray, which uses a Promotheus-database. Worked fine, only the lastupdated date was in unixformat and I couldn't get it working to show the regular date in a more readable format. It was written in golang.
After having modified a script to store pihole-stats in an InfluxDB I thought to modify that script to get the information from hub.docker.com in my InfluxDB. After a bit of testing I managed. Running it in a docker-container now.https://github.com/pluim003/dockerhub_influx
Upvotes: 0
Reputation: 5151
Since the Docker Hub does not have an out-of-the-box way to see the pull trend, I end up implementing a Prometheus exporter for myself and add a dashboard in my Grafana.
Below is the graph from PromQL: docker_hub_pulls{repo="$repo"}
.
Here is the Github link to my project: predatorray/docker-hub-prometheus-exporter.
Upvotes: 0
Reputation: 156
Only the statistics about number of pulls can be retrieved, at the moment. Then you can use Google Apps Script to record the number of pulls periodically and store it in a google sheet. You can find more about that here https://www.gasimof.com/blog/track_docker_image_pulls
Upvotes: 3
Reputation: 5849
You can get the total pull count and star count from the API:
https://hub.docker.com/v2/repositories/$1/$2
For example:
curl -s https://hub.docker.com/v2/repositories/library/ubuntu/ | jq -r ".pull_count"
Upvotes: 19