Created
April 7, 2022 14:32
-
-
Save hiddeco/81a83f9ce24f3772c8d8b293c2a9ff17 to your computer and use it in GitHub Desktop.
Tiny shell script to get exact stats from DockerHub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
if [ "$#" -eq 0 ] | |
then | |
echo -e "usage:\t$0 <image>" >&2 | |
echo -e "\t$0 mysql/mysql-server" >&2 | |
exit 1 | |
fi | |
if ! command -v jq &> /dev/n | |
then | |
echo "jq is not available on your system" >&2 | |
exit 1 | |
fi | |
image=$1 | |
url="https://hub.docker.com/v2/repositories/${image}/" | |
echo "Getting data for ${image}" >&2 | |
curl -s $url | jq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment